Write a C++ Program Which will Print the number in reverse order.


SUBMITTED BY: Nrupeshsinh

DATE: June 25, 2016, 12:19 p.m.

FORMAT: Text only

SIZE: 249 Bytes

HITS: 427

  1. # include<iostream.h>
  2. # include<conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. int n,r,rev=0,a;
  7. cout<<"Enter No :";
  8. cin>>n;
  9. a=n;
  10. while(n!=0)
  11. {
  12. r=n%10;
  13. rev=(rev*10)+r;
  14. n=n/10;
  15. }
  16. cout<<"Reverse of "<<a<<"is "<<rev<<".";
  17. getch();
  18. }

comments powered by Disqus