- 1
Plz tell what is the meaning of a&&b
and also solve. a=5 b=o thAn (a&&b)= ?
4 Respuestas
+ 3
Actually, is "a && b". && is the logical AND operator used for logical tests.
For example: "if(a && b) { i++;}".
Any value different from 0 is considered TRUE. In this case:
a && b is the same as
0 && 5 that is the same as
FALSE AND TRUE.
The result would be FALSE.
+ 1
The '&&' symbol is the AND operator. Both values on each side are Boolean values. There are two Boolean values: True and false.
For the && operator, both sides have to evaluate to true. If one of them is false, or both of them are false, then the && operator will return false.
Comparisons of numbers, other logical operators, and simple 'true or false' variables can be evaluated by the && operator. (They can also be evaluated by the OR operator, which is ||.)
Boolean operations don't work with numbers. In your case, 5 && 0 would produce an error. You can use the <, >, =<, =>, and == operators to compare 5 and 0. These comparison operators return a Boolean value: either true or false.
You can use Boolean operators and comparisons for "if" statements and "while" statements, and others.
- 2
&& is logical and... even if one expression is false (0) the overall expression is false otherwise it is true..
all numbers except 0 are true... thus a&&b.
i.e. 5&&0..
i.e. true(1) && false(0)
thus overall is false (0)
&& is like * (multiplication) and || is like +(addition).
hope you understood... greetings
- 2
&& operator represent logical AND operation it perform bit by bit AND operation on variable