Code:
#include <iostream>
using namespace std;
int main ()
{
long int y = 0,x;
cout <<"Enter any numeric value to be reversed:";
cin>> x;
while (x > 0)
{
y *= 10;
y += x % 10;
x /= 10;
}
cout <<y <<"\n";
return(0);
}

