Question 14Asked in UGC NET Computer Science, June 2015 (Paper II & III, Selected Questions)

Given that x = 7.5, j = – 1.0, n = 1.0, m = 2.0 the value of --x + j == x > n >= m is :

  1. A0
  2. B1
  3. C2
  4. D3
Show answerHide answer

Correct answer: (A) 0

Explanation

Relational operators > and >= have higher precedence than ==, so the expression is (--x + j) == ((x > n) >= m). --x makes x = 6.5, so LHS = 6.5 + (–1.0) = 5.5. RHS: (6.5 > 1.0) = 1, then (1 >= 2.0) = 0. 5.5 == 0 is false, so the value is 0.

From UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions)

This is question 14 of UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions). 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.