Advertisement
tonygms3

Question 2 Assignment

Dec 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5.  
  6.  
  7.     swap();
  8.  
  9.  
  10.     return 0;
  11. }
  12.  
  13.  
  14.  
  15. void swap()
  16. {
  17.     int num,ones,tens,hundreds,ans;
  18.     printf("Enter Number\n");
  19.     scanf("%d",&num);
  20.  
  21.     ones=(num%10)*100;
  22.     tens=num/100;
  23.     hundreds=((num%100)/10)*10;
  24.     ans=ones+tens+hundreds;
  25.  
  26.     printf("%d",ans);
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement