+ 6
What is the difference between& and &&?
There are two difference between them. .if they use as logical AND.both can be logical AND, when the & or && left or right expression results all is true the whole operation results can be true .when the both are false the result also false ...
4 Answers
+ 8
& operator is a bitwise AND, whereas && operator is a logical AND.
for more:
https://www.codeproject.com/Articles/662248/Difference-between-and-and
+ 3
& is used to acces memory of a variable and && is a logical (AND) operator....i mean in c++
+ 2
number1 & number2
means...
and operation of binary eqivalent of both..
6&7
>>110&111
>>(1&1)(1&1)(0&1)
>>110
>>6
& is bitwise and..
simply an AND GATE
&& is logical operator...
general syntax
if/while boolean && boolean
boolean can be false or true
0
& will add bit by bit of BCD number
but && is used in the condition statement
a=2. b=3
if(a<b && b>a)
cout<<a;
here in above code it's print "2" because both the condition in if statement is true