ProgrammingHard

printf("%c", 321); What is printed?

  1. A. B
  2. B. 1
  3. C. nothing, because 321 is out of range
  4. D. A

Correct answer: D. A

The %c conversion converts the int to unsigned char, so 321 is reduced modulo 256 to 65, which is 'A' in ASCII.

More C Programming questions

Exams that ask this topic