Advertisement
Josif_tepe

Untitled

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