Now question is & will do the same, what is the point? Point is to save operation time, if man is not true, quit looking for the bear, in short circuit if first is false, it will quit in short circuit operator(&&);
The And (&&) operator is used to perform a logical conjunction. If
the expressions on both sides of the And (&&) operator evaluate to
true, the And (&&) operation evaluates to true. If either
expression is false, the And (&&) operation evaluates to false, as
illustrated in the following examples:
Now question is & will do the same, what is the point? Point is to save operation time, if man is not true, quit looking for the bear, in short circuit if first is false, it will quit in short circuit operator(&&); |
|
Case 1. 1st operand is
|
![]() |
Data to be entered in a order so that the exit condition matches with &&
operators. Once 1st operand is valid, it would evaluate the 2nd operand
|
|
![]() |