Ask Coding C++ | SoloLearn: Learn to code for FREE!


Ask Coding C++

#include <iostream> using namespace std; int main(){ void main(){ int x; int y; int *p=&x; int *q=&y; *p =46; *q=39; x=x+y; cout << *p <<" " *q << endl; } }

2/3/2019 11:18:35 AM

Achmad Imannudin

4 Answers

New Answer


So, what is the question? ... Why do you have a main function with no return type, declared inside a main function which returns int? Do you need help to correct your code? Do you need help explaining the output of the code (given that the errors are corrected) ?


You entered " " followed by *q, but it you had to enter " " << *q at the cout line.


Sorry, I have error code


Yes, help to correct code