Advertisement
Josif_tepe

Untitled

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