sahajjain01

Display a number's digits reversed.

Aug 21st, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. //Program to display a number's digits reversed.
  2. #include<iostream.h>
  3. #include<conio.h>
  4. void main()
  5. {
  6.     clrscr();
  7.     int a;
  8.     cout<<"Enter a number to display it's digits reversed: ";
  9.     cin>>a;
  10.     a=(a%10)*(10)+(a/10);
  11.     cout<<"The reversed number is: "<<a;
  12.     getch();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment