C++ Program to find reverse of a input number

      No Comments on C++ Program to find reverse of a input number
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,y=0;
cout<<"Enter number to find reverse:"<<endl;
cin>>x;
while(x>0)
{
y=y*10;
y=y+x%10;
x=x/10;
}
cout<<"Reverse of a number is: "<<y;
getch();
}

OUTPUT:-

Leave a Reply

Your email address will not be published. Required fields are marked *