Advertisement
Josif_tepe

Untitled

Dec 21st, 2024
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int n;
  6.     scanf("%d", &n);
  7.    
  8.     int prevrten_broj = 0;
  9.    
  10.     int tmp = n;
  11.     while(tmp > 0) {
  12.         int cifra = tmp % 10;
  13.         tmp /= 10;
  14.        
  15.         prevrten_broj = (prevrten_broj * 10) + cifra;
  16.     }
  17.    
  18.     printf("%d\n", prevrten_broj);
  19.     return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement