Code:#include <stdio.h> int expr(char str[], int i){ printf("%s \n",str); return i; } int main() { if(expr("1st",1) || expr("2nd",0) && expr("3rd",1)); return 0; } )
output
-------
1st
Logical and has Higher precedence then logical or
Then why the above code evaluated expr("1st",1) first
and not expr("2nd",0) && expr("3rd",1)



LinkBack URL
About LinkBacks


