Computer Science - Object Oriented Programming Using C++ - Discussion

10. 

Evaluate the following expression: 4 >6 || 10 < 2 * 6

[A]. True
[B]. False

Answer: Option A

Explanation:

No answer description available for this question.

Ravi said: (Dec 9, 2011)  
How it is true. ?

Can any one Explain.

Anand said: (Jan 5, 2012)  
Check the precedence table of operators

'*' then '>' , '<' (left to right)
then '||'

4>6 is false
10 < 12 is true
false || true is always true.

By Default said: (Mar 7, 2012)  
In OR condition if one get false and other is true then it always returns true value.

Here 4 > 6 gives false value that is 0 so or operator moves forward and check for next condition that is 10 < 6 * 2 i.e.

10 < 12 so the operation evalutes to a true value.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.