Advertisement
dsdeep

Task-1.3(SWAP)

Mar 12th, 2020
134
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. int main()
  3. {
  4.     int a,i,sum=0;
  5.     scanf("%d",&a);
  6.     for(i=a; i>0; i--)
  7.     {
  8.         sum=a%10;
  9.         a/=10;
  10.         if(sum==0&&a==0)
  11.             break;
  12.         printf("%d",sum);
  13.  
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement