ProgrammingHardTCS NQT · Infosys

int arr[10]; What is sizeof(int[10]) / sizeof(int)?

  1. A. 40
  2. B. 1
  3. C. 4
  4. D. 10

Correct answer: D. 10

sizeof(int[10]) is ten times sizeof(int), so the ratio is 10 on every platform. The sizeof values themselves are not fixed, but the ratio is.

More C Programming questions

Exams that ask this topic