Please tell me how do I print a bit, like printf(\"%d\",bit);.
printf(\"%d\",bit);
Related question: How do you set, clear, and toggle a single bit? is an extended discussion of single-bit access in c and c++.