Program code:
#include<iostream>
using namespace std;
int main()
{
cout<<"**************************************"<<endl;
cout<<" Program to Reverse any Number "<<endl;
cout<<"**************************************"<<endl<<endl;
int num, r , rev=0;
cout<<"Enter any Number = ";
cin>>num;
while(num)
{
r = num%10;
rev = rev * 10 + r;
num= num /10 ;
}
cout<<endl<<endl;
cout<<"Reverse of Entered number is = "<<rev<<endl;
cout<<"**************************************";
return 0;
}
No comments:
Post a Comment