UGC-NET | UGC NET CS 2016 July – II | Question 11

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
(A) -1
(B) 0
(C) 1
(D) 2


Answer: (C)

Explanation:

  = x * y < i + j || k
  = 0.5 * 0.0 < 0 + 1 || -1
  = 0.0 <  0 + 1 || -1 
  = 0.0 < 1 || -1
  = 1 || -1
  = 1

So, option (C) is correct.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.