If I want to make a if statement that requires more than one thing to be true do I need to do it with “else if”? Because I think it looks ugly so I would prefer if I could solve that in one statement.
Here is the code:
if(x == 2 OR 4 OR 6 OR 8 OR 10)
{
something......
}
etc. etc.
return 0;
Will that work?
OTOH, if your intent is, “If x is even…”: