ProgrammingHardTCS NQT · Infosys

What is printed?

What is printed?
printf("%d %d", '\0', '0');
  1. A. 0 0
  2. B. 48 0
  3. C. 0 48
  4. D. 48 48

Correct answer: C. 0 48

'\0' is the null character, value 0, which ends every C string. '0' is the digit character, code 48 in ASCII. Confusing the two is a classic source of string bugs.

More C Programming questions

Exams that ask this topic