#include<iostream.h>
void main()
{
int n;
cout << "Enter a 2 digit number : ";
cin >> n;
if(n<=0 || n>99)
cout<<"!!! Invalid Number !!!"<<endl;
else
{
int n2 , n3;
n2 = n % 10;
n3 = n / 10;
cout << "You Entered : "<< n3<<n2<<endl;
cout << "The reverse of that no is : " << n2<<n3<<endl;
}
}
Output:
Enter a 2 digit number : 61
You Entered : 61
The reverse of that no is : 16
Press any key to continue |