Josif_tepe

Untitled

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