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

Discussion Forum : Object Oriented Programming Using C++ - Section 1 (Q.No. 7)
7.
Evaluate the following expression: 3 >6&&7>4
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
23 comments Page 2 of 3.

Prajakta said:   1 decade ago
&&:it is a logical and operator in which result is true only when.

Both conditions are true otherwise result is false.

3>6 && 7>4.

false && true.

false.

Pawan said:   1 decade ago
In && Operator if the (left side of && )first Condition False then compiler don't check the Condition(right side of &&) after the && operator.

3 > 6 && 7 > 4

3 > 76 false then no need of evaluate 7 > 4.

Sumit said:   1 decade ago
In the expression the priority of various operator is as follow && (AND) than || (OR) than ! (NOT).

So here we have only and operator which means the expression is only true when both the condition is true.

Here 2nd condition is true but the first condition is false.

So expression is false.

Faisal said:   1 decade ago
There are two conditions if one false then return false.

e.g. Both conditions must be true.

1*0 = 0.
1*1 = 1.
0 = false.
1 = true.

Tharun said:   1 decade ago
Hear the internal concept is logical operator (&&).

And according to the bit-wise operator (AND '^') we use and hear 3>6 is false we consider it is 0 and 7>4 is true we consider it is 1.

According to the truth table 0^1 is 0. It means false.

Shariq said:   1 decade ago
First condition evaluated is 3>6 which is not true, condition is not checked further.

After which, if it was written 3<6, which is true then only second condition is tested for its trueness or false,

Let us consider condition before && evaluated true.

2 cases arise if the next condition is true or not.

Accordingly then, use of && operator states if any one of i/p is false then result is false.

Noora said:   1 decade ago
3>6 is false
7>4 is true

In this expression AND condition is used
In and if one statement is false all result is false 3>6&&7>4

AZLAN Tanveer said:   1 decade ago
&& operator is comes under logical operator, if all operands i.e. conditions are true it evaluates to true and if any one or more than one or all of them are wrong it will evaluate to false.

It is necessary that all conditions should be true.

Divya said:   1 decade ago
Ya its right the use Of && is for comparison thereby here answer is false.

MUKESH said:   1 decade ago
3 is not greater than 6 i.e 3>6=false.
7 is greater than 4 i.e 7>4=true
Single & is used for logical & operation,while && is used for comparison of conditions therefore it is false.


Post your comments here:

Your comments will be displayed after verification.