printf() doesn't directly support that. Instead you have to make your own function.
Something like:
while (n) { if (n & 1) printf("1"); else printf("0"); n >>= 1; } printf(" ");
548k questions
547k answers
4 comments
86.3k users