Skip to content
- You are calling the function
- That is the order since you are printing AFTER you are processing the rest of the number. Try moving the call to
printf before the call to
foo and see if you get anything different.
sum is changing because you are doing
sum = sum + k and passing it to all the future calls.
n eventually becomes
0 due to repeated divisions, the last call to
foo starts returning and following them all the previous calls start returning after printing the digit they had extracted using
n % 10
Browse More Popular Posts