Advertisement
enigmjoe

Hh

Dec 17th, 2021
1,098
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1.  
  2. #include<stdio.h>
  3.  
  4. int main()
  5. {
  6. int number, answer=0;
  7. scanf("%d",&number);
  8.  //s    arthak
  9.  while(number !=0){
  10. int digit = number % 10;
  11.  
  12. answer = (answer*10) + digit;
  13.  
  14. number = number / 10;
  15. }
  16.  //printing
  17.  while(answer != 0){
  18.  
  19. int digit2 = answer % 10;
  20. printf("%d\n",digit2);
  21. answer /= 10;
  22. }
  23. }
  24.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement