Print reverse number

#include
int main()
{
int N,y=0;
cin>>N;
while(N!=0){
y=y*10+N%10;
N=N/10;
}
cout<<y;
return 0;
} my code is correct but why its shows complier error!!

This code is working properly:

#include
using namespace std; //you must be missing this statement
int main()
{
int N,y=0;
cin>>N;
while(N!=0){
y=y*10+N%10;
N=N/10;
}
cout<<y;
return 0;
}

Can you see the difference? Think.

Hope, this would help.
Give a like, if you are satisfied.