All rights are reserved by Niteesh Kumar.. Theme images by Storman. Powered by Blogger.

Followers

Total Pageviews

Blog Archive

Follow by Email

Translate

Thursday, 8 May 2014

C++ program to find the reverse of a number.



#include<iostream.h>
#include<conio.h>
void main()
{clrscr();
intr,n,rev=0;
cout<<"enter any no.=";
cin>>n;
do
 {r=n%10;
rev=10*rev+r;
 n=n/10;
 }
while(n!=0);
cout<<"reverse no. is="<<rev;
getch();
 }

OUTPUT
enter any no.=54

reverse no. is=45

0 on: "C++ program to find the reverse of a number."