#include
using namespace std;
int main()
{
int a;
A:
cin>>a;
if(a==42) return 0;
cout<<a;
goto A;
return 0;
}
1 Like
for input
1
2
3
42
it prints
123
1 Like
try adding a new line character after printing each time… cout<<a<<endl; instead of cout<<a; …hope this helps…
1 Like