Advertisement
SabirSazzad

Integer reverse

Feb 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int n,div,rem;
  5.     printf("Input an Integer: ");
  6.     scanf("%d",&n);
  7.     printf("The reverse number is: ");
  8.     do
  9.     {
  10.         div=n/10;
  11.         rem=n%10;
  12.         printf("%d",rem);
  13.         n=div;
  14.     }while(n!=0);
  15.     return;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement