Multiply by 8 (left shift by 3 bits) and then subtract the number.
(x << 3) - x
Multiply by 8 (left shift by 3 bits) and then subtract the number.
(x << 3) - x
void putlong(unsigned long x)
{
// we know that 32 bits can have 10 digits. 2^32 = 4294967296
for (unsigned long y = 1000000000; y > 0; y /= 10) {
putchar( (x / y) + '0');
x = x % y;
}
}