mdnurnobihosen

Assignment10.2

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