Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <stack>
- #include <stdlib.h>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int reverse(int num)
- {
- int temp = num;
- int sum = 0;
- while (temp)
- {
- sum*=10;
- sum += temp%10;
- temp/=10;
- }
- return sum;
- };
- int main()
- {
- int y,x = 05;
- y = reverse(x);
- cout << y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment