Advertisement
Josif_tepe

Untitled

Nov 13th, 2022
839
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.  
  4. int main() {
  5.     int N;
  6.     scanf("%d", &N);
  7.    
  8.     while(N > 0) {
  9.         int posledna_cifra = N % 10;
  10.         printf("%d ", posledna_cifra);
  11.         N /= 10;
  12.     }
  13.    
  14.     return 0;
  15. }
  16. // 134 % 10 = 4
  17. // 134 /= 10 --> 13
  18.  
  19. // 13 % 10 = 3
  20. // 13 / 10 = 1
  21.  
  22. // 1 % 10 = 1
  23. // 1 / 10 = 0
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement