Write an application to check a number is even or odd.
Numbers which are divisible by 2 are even numbers whereas the numbers which are not divisible by 2 are odd numbers.
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.