Odd One Out


Create a program that can tell you if a number is odd or even.

Even vs. Odd

So what makes a number odd? What makes a number odd? Once we have a clear understanding of this we can translate that knowledge into a program.

Some examples of even numbers are

2, 4, 6, 8, 10, 12, 14, 16, 18, 20

What do all these numbers have in common?

All of these numbers are divisible by 2!

What exactly does divisible by 2 mean?

When you divide by 2 you get a remainder of 0

When you continue to subtract 2 from the number you eventually end up at 0

The number has 2 as one of its factors

We will be using the first rule for out program!

Final code