+ 1
Sysntex question
what is the different between & and && ?
8 Answers
+ 1
& -> "unary and" deals with binary numbers
&& -> "logical and" deals with conditions
+ 1
take me an example
+ 1
true&true does work .. hinanawi and it returns true and false based on the binary calculations... 1 for true and 0 for false...
+ 1
& works on the binary ewuivalent of the values as already stated by hinanawi whereas && works for logical comparasions between binary data types... (in java, its true and false whereas in c and c++, its 0 and 1)
+ 1
Jain Rishav Amit true&true works depending on the language, yes
+ 1
yes... hinanawi , as c does not have anything like true or false... it solely works on 0 and 1
0
example:
true && true <=> true
true && false <=> false
true & true - doesn't work
1 & 1 == 1
2 & 6 == 2 (010 & 110 == 010)
1 && 2 - doesn't work
0
how can make aqusation