Write an application to check a number is even or odd.

Solution)
Numbers which are divisible by 2 are even numbers whereas the numbers which are not divisible by 2 are odd numbers.

Example:

2, 6, 8, 12, 20 are some examples of even numbers. These numbers are divisible by 2.

3, 5, 7, 11, 15 are some examples of odd numbers. These numbers are not divisible by 2.

Even number of objects can be grouped in pairs whereas odd number of objects can not be grouped in pairs.

In order to find whether a number is an even number or odd number, divide the number by 2. If the remainder obtained on dividing the number by 2 is 0, then the number is an even number otherwise it is an odd number.

So, numbers end with 0, 2, 4, 6, 8 are divisible by 2 and numbers end with 1, 3, 5, 7, 9 are not divisible by 2 are odd numbers. 
Hence, this method helps to find whether a number is odd or even regardless of how many digits it has by looking at final digit.

  • 0
If it is divisible by 2
  • 0
What are you looking for?