## abhimanipal 91

Hello,

``````main()
{
int i=4,j=7;
j = j || i++ && printf("YOU CAN");
printf("%d %d", i, j);
}``````

The answer to this question is 4 1 and the reasoning is that the compiler finds j to be true and hence does not need to check the remaining statement
But the precedence of the && operator is greater than the || . So the compiler should compute the operands of the && operator first right ?

## Ancient Dragon 5,243

Statements are always evaluated from left to right unless parentheses change the order of evaluation. Add parentheses to do what you are thinking `(j = j || i++) && printf("YOU CAN");`

## abhimanipal 91

``int i= 2+3*5;``

would evaluate to 25 .But it evaluates to 17 that is because the multiplication operation is done first, as it has higher precedence.

## Salem 5,138

> Statements are always evaluated from left to right unless parentheses change the order of evaluation.
Only for boolean expressions involving &&, ||, or the ?: operator.

## Ancient Dragon 5,243

``int i= 2+3*5;``