Multiple "if" conditions?

closed account (967L1hU5)
Is it possible to have more than one condition in one "if" statement? I read somewhere online that using "|" like this:
1
2
3
4
if (x == 7 | 8 | 9)
{
    action
}

would do it, but it would not compile. Is it possible? And if so, what is an easy way to do it?
Like this:
if (x==7 || x==8 || x==9)
closed account (967L1hU5)
Many thanks.
Topic archived. No new replies allowed.