How Can I compare Even Integers to Odd?

I want to to skip every other integer or odd integers, how can I do this?

1 Like

You can use Modulo function(your integer to top input and 2 to the bottom) to get the remainder of the integer when it is divided by 2. If the result is greater than 0 it means the integer was an odd number.

84953-oddeven.jpg

3 Likes

Thank you

3 Likes

You could also use bitwise operators. I don’t fully understand them myself but they are extremely powerful and efficient operators! Here’s a quick way to find if a number is odd or even:

Even is true; odd is false.

281434-desktop-screenshot-20190703-23594372.png

1 Like

thanks for this comment, love seeing new functions of execution!

fantastic!

I think you got that mixed up. True is Odd, and False is Even