0
why this result shows 0?
https://code.sololearn.com/c2H3Vj9Cxzk8/?ref=app I thought a&&a is true, so result will be 1. but it wasn't. Why it shows 0, instead of 1? #include <iostream> using namespace std; int main() { int a=0; cout << (a&&a); return 0; }
1 Resposta
+ 5
a=0 which is false so the next 'a' is not even looked at by the compiler and the whole expression is evaluated to false which is a binary 0.