Advertisement
Guest User

Untitled

a guest
Sep 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <conio.h>
  3. #include <math.h>
  4.  
  5. int Inversa(int num, int b=0)
  6. {
  7.     if(num==0)
  8.     return 0;
  9.     else
  10.    {
  11.         b=num % 10;
  12.         num=num / 10;
  13.         cout<<b;
  14.         return Inversa(num,b);
  15.     }
  16. }
  17.  
  18. void main(void)
  19. {
  20.     int num, result, b=0, x;
  21.     cout<<"INVERSA DE UN NUMERO"<<endl;
  22.     cout<<"--------------------"<<endl;
  23.     cout<<"Ingrese numero:"<<endl;
  24.     cin>>num;
  25.     cout<<"El numero invertido es:"<<endl;
  26.     result=Inversa(num,b);
  27.     getch();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement