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; } }
Data structures, Algorithms, Coding, Technical Interview Questions and much more. (Still work in progress)
0 comments:
Post a Comment