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

Given i = 0, j = 1, k = –1, x = 0.5, y = 0.0 What is the output of the following expression in C language?

Given i = 0, j = 1, k = –1, x = 0.5, y = 0.0 What is the output of the following expression in C language? x * y < i + j || k
  1. A-1
  2. B0
  3. C1
  4. D2
Show answerHide answer

Correct answer: (C) 1

Explanation

Given i = 0, j = 1, k = –1, x = 0.5, y = 0.0. x * y < i + j || k = (((x * y) < (i + j)) || k) = (((0.5 * 0.0) < (0 + 1)) || –1) = ((0 < 1) || –1) = 1

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

This is question 16 of UGC NET Computer Science PYQ, June 2016 (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.