public class Test{
public static void main(String args[]){
int a = 0;
int b = 1;
int c = 10;
if ( a == 0 || b++ == c ){
a = b + c;
}else{
b = a + c;
}
System.out.println("a: " + a + ",b: " + b + ",c: " + c);
}
}
Ok, this is Java code, and the output is a: 11, b: 1, c: 10 And I believe that C acts the same as Java in this case
This is because the second condition (b ++ == c) will never be met if the first condition is true in the OR operator.
There is "NAME" for this. I just donβt remember what it is. Does anyone know what this is called?
source
share