Question 57Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

What is the output of the following JavaScript code? let x = 10;

What is the output of the following JavaScript code? let x = 10; if (x > 5) { console.log("Greater"); } else { console.log("Smaller"); }
  1. A"Smaller"
  2. B"undefined"
  3. C"Greater"
  4. DError
Show answerHide answer

Correct answer: (C) "Greater"

Explanation

x is 10, so the condition x > 5 is true and console.log prints "Greater".

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 57 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). 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.