Basic and Advance C Question:

Download Job Interview Questions and Answers PDF

Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

C Programming Interview Question
C Programming Interview Question

Answer:

No, on both counts, although there are various preprocessor tricks you can try. You can convert base-2 string representations to integers with strtol. If you need to print numbers out in base 2, .

Download C Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What is the most efficient way to count the number of bits which are set in an integer?How can I convert integers to binary or hexadecimal?