Basic If Statement Question

Write your question here.
I'm looking at some code and I got to an if statement
1
2
3
if(x%y) || (y == 2){

}


What in the heck is the x%y? I get that it's modulus/remainder but in this content does it mean if the remainder is 0 to count it as true?
No.
if(any expression here)
will be true when the expression evaluates to NOT 0.
Usually a boolean true, but for the modulo operator, as for any integer number, it will be true when the result is NOT 0.
Last edited on
Topic archived. No new replies allowed.