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
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