Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <conio.h>
- #include <math.h>
- int Inversa(int num, int b=0)
- {
- if(num==0)
- return 0;
- else
- {
- b=num % 10;
- num=num / 10;
- cout<<b;
- return Inversa(num,b);
- }
- }
- void main(void)
- {
- int num, result, b=0, x;
- cout<<"INVERSA DE UN NUMERO"<<endl;
- cout<<"--------------------"<<endl;
- cout<<"Ingrese numero:"<<endl;
- cin>>num;
- cout<<"El numero invertido es:"<<endl;
- result=Inversa(num,b);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement