How is i==(20||10) evaluated?
#include <stdio.h> int main(void) { int i=10; if(i==(20||10)) printf("True"); else printf("False"); return 0; } This gives the output False . Please explain to me how does this program work? This line if(i==(20||10)) always evaluates to i==1 as Alk said in comments - (20||10) evaluates to 1 , hence when you compare i == 1 , that is why you get False as the output. A non-Zero value in C implies true. Read about Short-circuit evaluation Perhaps this is what you wanted: int i=10; if(i==20 || i == 10) printf("True"); else printf("False"); look at if(i==(20||10)) . Due to the inner parentheses, 20|