like what will be the output of
0 && 1 || 1
it may be either 0 if started from || operator or may be 1 if started from && operator.
1/15/2017 6:59:58 AM
I've tested with Code Playground and I have obtained 1. You might have to check your code syntax.
Tsk, your code outputs zero because cout prints what comes next directly, like return. To clear up the confusion, place brackets to your entire statement after cout.
cout<<(0 && 1 ||1);
0 && 1 || 1 should end up being 1.
I agree with Hasty. Can we see your code?
Thanks @hatsy rei.
It was my silly mistake.
You could check my code "operator".
Plz it's giving 0 as output.
But when I tried it in code playground it results in 0.
It also says && has higher priority over || so answer would be 1 but it gives 0.
Send us a message