WAP TO ENTER THREE NO. AND PRINT REVERSE OF THE NO.
#include<iostream.h>
#include<conio.h>
void main()
{
int number,reverse=0;
clrscr();
cout<<"Enter three no.:";
cin>>number;
for(;number!=0;)
{
reverse=reverse*10;
reverse=reverse+number%10;
number=number/10;
}
cout<<"Reverse of no. is:"<<reverse;
getch();
}
#include<conio.h>
void main()
{
int number,reverse=0;
clrscr();
cout<<"Enter three no.:";
cin>>number;
for(;number!=0;)
{
reverse=reverse*10;
reverse=reverse+number%10;
number=number/10;
}
cout<<"Reverse of no. is:"<<reverse;
getch();
}
Comments
Post a Comment