0

Can anyone explain how the and statement is not included in output

#include <stdio.h> int main() { int i=4, j=7; j = j || i++ && printf("you can"); printf("%d %d", i, j); return 0; } Please explain the whole code

26th Aug 2019, 2:16 PM
Preity
Preity - avatar
4 odpowiedzi
+ 2
The || operator checks for true values. If the first value is true, then it won't bother checking the other side, so the whole && thingy will have been left out.
26th Aug 2019, 2:22 PM
Airree
Airree - avatar
+ 1
But as and operator has higher precedence then why that is not evaluate at first OR this is an exception in logical operators
26th Aug 2019, 3:27 PM
Preity
Preity - avatar