ProgrammingHard

char s[5] = "abc"; printf("%d", s[4]); What is printed?

  1. A. 0
  2. B. 97
  3. C. 99
  4. D. 32

Correct answer: A. 0

The array has room for five characters, and the unused tail is zero, so s[4] is 0.

More C Programming questions

Exams that ask this topic