Life, universe and everything! Please help! What is wrong in my code (c++)??

#include

using namespace std;

int main()

{

int a;

cin >> a;

while (a != 42)

{

cout << a;

cin >> a;

}

return 0;

}

each output should be in next line. use cout<<a<<endl;

4 Likes