+ 1

Sysntex question

what is the different between & and && ?

19th Jun 2018, 5:03 PM
Rahman Rezaie đŸ‡ŠđŸ‡«
Rahman Rezaie đŸ‡ŠđŸ‡« - avatar
8 Answers
+ 1
& -> "unary and" deals with binary numbers && -> "logical and" deals with conditions
19th Jun 2018, 5:13 PM
‎ ‏‏‎Anonymous Guy
+ 1
take me an example
20th Jun 2018, 5:14 AM
Rahman Rezaie đŸ‡ŠđŸ‡«
Rahman Rezaie đŸ‡ŠđŸ‡« - avatar
+ 1
true&true does work .. hinanawi and it returns true and false based on the binary calculations... 1 for true and 0 for false...
26th Jun 2018, 7:22 AM
Jain Rishav Amit
Jain Rishav Amit - avatar
+ 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)
26th Jun 2018, 7:27 AM
Jain Rishav Amit
Jain Rishav Amit - avatar
+ 1
Jain Rishav Amit true&true works depending on the language, yes
26th Jun 2018, 7:59 AM
hinanawi
hinanawi - avatar
+ 1
yes... hinanawi , as c does not have anything like true or false... it solely works on 0 and 1
26th Jun 2018, 8:09 AM
Jain Rishav Amit
Jain Rishav Amit - avatar
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
20th Jun 2018, 12:24 PM
hinanawi
hinanawi - avatar
0
how can make aqusation
21st Jun 2018, 10:12 AM
Rahman Rezaie đŸ‡ŠđŸ‡«
Rahman Rezaie đŸ‡ŠđŸ‡« - avatar