In C or C++
if ( x )
statement1;
else
statement2;
For what value of x will both statements be executed?
I know we can execute if-else together like this:
if(1){
goto ELSE;
}
else{
ELSE:
}
Is there any way, like a value?
(Which I think is not possible. Asking because someone is arguing!)
There is no such value: either the value evaluates to
true(something != 0), or it evaluates tofalse) (0). No other possible values exist.That works but it isn’t depending of the value of the
ifcondition at all.