Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void pu(int x,int p, int u)
- {
- u=x%10;
- int nr=0;
- int xx=x;
- while (xx)
- {nr=nr*10+xx%10;
- xx=xx/10;
- }
- p=nr%10;
- }
- int main()
- {
- int p,u;
- pu(1005,p,u);
- cout<< p<<" "<< u;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment