Write a program that inputs a three digit number from the user and display it in reverse order. For example if the user enter 123, it display 321.
#include<iostream>
using namespace std;
int main()
{
int n,r;
r=0;
cout<<"\t Reverse Order of Numbers "<<endl;
cout<<"\n";
cout<<"Enter the number you want to reverse "<<endl;
cin>>n;
for ( ; n!=0 ; )
{
r=r*10;
r=r+n%10;
n=n/10;
}
cout<<"\n";
cout<<"The number after reversed is "<<r<<endl;
}