ProgrammingModerate

printf("%d", sizeof(int[4]) / sizeof(int)); What is printed with 4-byte int?

  1. A. 16
  2. B. 4
  3. C. 1
  4. D. 8

Correct answer: B. 4

sizeof(int[4]) is 16 bytes, and dividing by 4 gives the element count, 4.

More C Programming questions

Exams that ask this topic