Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(void)
- {
- int num = 0, length = 1, Rnum = 0;
- scanf("%i", &num);
- if(num < 0)
- {
- num *= -1;
- }
- printf("reverse: ");
- while(num >= 1)
- {
- printf("%i", num % 10);
- Rnum += num * length;
- length *= 10;
- num /= 10;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement