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
Discussion:
23 comments Page 2 of 3.
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.
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.
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.
3 > 6 && 7 > 4
3 > 76 false then no need of evaluate 7 > 4.
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.
Both conditions are true otherwise result is false.
3>6 && 7>4.
false && true.
false.
Sapsarala said:
1 decade ago
Ya 3>6 is false and using of && so this statement is false.
Michael samonte said:
1 decade ago
&& is a logical operator that is true only if both are true, otherwise, it is false.
Amit Kumar said:
10 years ago
Because of in general way if we will look then here is the used operator is AND and In && operator if both the conditions are true then only the output or result would be true otherwise result would be false. As 3 is not greater than 6 hence the answer is false for this.
Sourabh said:
10 years ago
In these expression we compare two condition if both of the condition returns true then the it returns truth value. Here && operand is a is a Logical AND, it checks both the given Condition.
3>6 i.e. FALSE.
7>4 i.e TRUE.
True&&False=False.
Hence, the answer is false.
3>6 i.e. FALSE.
7>4 i.e TRUE.
True&&False=False.
Hence, the answer is false.
(1)
Vrushabh said:
9 years ago
3>6 is false and we used && operator which gives the combined result as false.
Bilal munniwale said:
8 years ago
Whats the use of && operator here?
Amarjeet Singh said:
7 years ago
Here the condition 3>6 && 7>4 becomes false but in this, the compiler only checks first condition 3>6 because in the case of logical and (&&) operator if the first condition becomes false then there is no need of checking the second condition.
Apart from this, if the first condition becomes true then compiler go for checking the second condition.
Apart from this, if the first condition becomes true then compiler go for checking the second condition.
(1)
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers