 <p><code>n/10</code> will not shift the decimal number since <code>n</code> is an integer. The division will produce the result like this: if n = 25, then <code>n/10</code> would be 2 (without any decimal points), similarly if n = 9, then n/10 would be 0 in which case <code>if</code> condition would not be satisfied.</p> <p>Regarding the <code>+'0'</code>, since n%10 produces an integer result and in <code>putchar</code> you are printing a <code>char</code> , you need to convert the integer to a char. This is done by adding the ascii value of 0 to the integer.</p>