--------------------------------------------------------
// Program to find Reverse of any number//
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"\nEnter a number:";
cin>>n;
cout<<"\nYou entered: "<<n;
j=0;
while(n>0)
{
i=n%10;
j=j*10+i;
n=n/10;
}
cout<<"\nReverse of number is:"<<j;
getch();
}
No comments:
Post a Comment