Question 127

What is the output? int a = 10;

What is the output? int a = 10; if (a = 0) printf("Zero"); else printf("NonZero");
  1. AZero
  2. BZeroNonZero
  3. CCompile error
  4. DNonZero
Show answerHide answer

Correct answer: (D) NonZero

Explanation

a = 0 is an assignment whose value is 0 (false).

From DSSSB TGT Computer Science Full Mock Test 2

This is question 127 of DSSSB TGT Computer Science Full Mock Test 2. 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.