ProgrammingHardStatement-count style · Product-company MCQ pattern

How many of these are correct in C? (i) A global variable without an initialiser starts as 0. (ii) A static local variable is initialised only once. (iii) An uninitialised auto local variable starts as 0. (iv) The address of a register variable can be taken with &.

  1. A. Only one
  2. B. Only two
  3. C. Only three
  4. D. All four

Correct answer: B. Only two

(i) true: objects with static storage duration are zero-initialised. (ii) true. (iii) false: an auto local holds an indeterminate value. (iv) false: C forbids & on a register variable (C++ allows it). So two.

More C Programming questions

Exams that ask this topic