0

doubt with a code in C++

Why this code results in "0"? int a=10; int main() { cout<<(a==9) }

15th Feb 2020, 7:06 PM
LUIS MANUEL LOPEZ SEPULVEDA
8 Answers
+ 2
0 means condition result is false because a is not equal to 9
15th Feb 2020, 7:14 PM
Mukul Singh Bhist
Mukul Singh Bhist - avatar
+ 2
0 because 10 is not equal to 9.i think you have to include <stdbool.h> for using bool.
17th Feb 2020, 2:14 AM
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ - avatar
+ 1
0 means condition result is false because a is not equal to 9
16th Feb 2020, 6:01 AM
robin kansal
robin kansal - avatar
+ 1
0
16th Feb 2020, 3:48 PM
Jagbir singh
Jagbir singh - avatar
0
If a=10, I understand that in the next line, "a" keeps te value, and then test equal to 9, but I donÂŽt undertsand why the result is "0"
15th Feb 2020, 7:12 PM
LUIS MANUEL LOPEZ SEPULVEDA
0
Thanks a lot Roman J, for the clarification Best Regards
15th Feb 2020, 7:15 PM
LUIS MANUEL LOPEZ SEPULVEDA
0
Where u use (9==10) its treat like if, else condition. here 9 is not equal to 10 so condition false and output become 0
16th Feb 2020, 10:10 AM
A S Raghuvanshi
A S Raghuvanshi - avatar