edited by
3,804 views

2 Answers

Best answer
7 votes
7 votes

Answer : 1

x*y < i + j || k 

if we go a/c to precedence and associativity then lets parenthesize it 

(((x*y) <( i + j)) || k) 

* Has higher precedence then + and a/c to associativity they are left to right 

comparison operator has less precedence then "*" and "+" .

Logical Or has lest precedence among all the operator .So

first we calculate (x*y) then ( i + j) after that ((x*y) <( i + j)) and finally

(((x*y) <( i + j)) || k) 

(x*y) = 0       ( i + j) = 1 

(( 0.0 < 1 ) || k ) Here LHS holds true  means we don't care what is the value of k it will always be True in case of OR .So Answer must be 1.

selected by
1 votes
1 votes
x+y<i+j || k

0.5(0) consider it as interger + 0.0 < 1 + 0 is true  

so output is 1
Answer:

Related questions

4 votes
4 votes
2 answers
1
3 votes
3 votes
1 answer
2
go_editor asked Aug 14, 2016
3,454 views
What is the value returned by the function f given below when n=100?let f(int n) { if (n==0) then return n; else return n+f(n-2); }2550255652205520
4 votes
4 votes
1 answer
3