Question 40Asked in DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

What will happen if the following declaration is used in C? int a, b, c = 10;

What will happen if the following declaration is used in C? int a, b, c = 10;
  1. AOnly c is initialized to 10; a and b are uninitialized.
  2. BSyntax error due to missing initialization of a and b.
  3. Ca, b, and c are all initialized to 10.
  4. DRuntime error
Show answerHide answer

Correct answer: (A) Only c is initialized to 10; a and b are uninitialized.

Explanation

In int a, b, c = 10; the initialiser belongs only to c. a and b are declared but left uninitialised (garbage if local).

From DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

This is question 40 of DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.