Advertisement
mustahidhasan

reverse

Feb 25th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.    int n, reverse = 0;
  6.  
  7.    scanf("%d", &n);
  8.  
  9.    while (n != 0)
  10.    {
  11.       reverse *= 10;
  12.       reverse += n % 10;
  13.       n /= 10;
  14.    }
  15.  
  16.    printf("%d\n", reverse);
  17.  
  18.    return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement