Before we start writing code let us understand what is odd number or even number and logic behind it. An even number is any number that are perfectly divisible by 2. Example 2 , 4, 6, 8 …. An odd number is any number that are not perfectly divisible by 2. Example 1, 3, 5,