Tuesday, September 6, 2016

Tags

PROGRAM TO FIND REVERSE OF A NUMBER ENTERED BY USER:
//program to reverse a number entered by user
#include<iostream>
using namespace std;
class reverse
{
int num,a,b,rev=0;
public:
void rever()
{
cout<<"ENTER ANY NUMBER TO FIND ITS REVERSE";
cin>>num;
while(num!=0)

{
a=num%10;
num=num/10;
rev=(rev*10)+a; }
cout<<"\nREVERSE IS "<<rev;
}
};
main()
{
reverse r;
r.rever();
}