Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int n;
- scanf("%d", &n);
- for(int i = n; i > 0; i /= 10) {
- int cifra = i % 10;
- printf("%d ", cifra);
- }
- return 0;
- }
- // 456
- // i = 456, cifra = 6
- // i = 45, cifra = 5
- // i = 4, cifra = 4
- // i = 0
Advertisement
Add Comment
Please, Sign In to add comment