C# Program to check whether the entered Number is Even or Odd1 min read

This article of C# Program checks if a given integer is Odd or Even, we have used the ternary operator (?:) and also seen the use of try and catch block.

Solution:
The user enters the number that needs to be check for odd or even number. Here the entered number is checked with i % 2 == 0, that is if after the divisibility of an entered number by 2, the remainder is zero then it is an Even number but if the remainder is not zero then the entered number is Odd number.

C-Sharp(C#) Program to check whether the entered Number is Even or Odd.

Source Code:

The output of to find odd or even integer in C#.

C sharp odd and even number