Here is source code of the C# program which checks a given integer is odd or even. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
* C# Program to Check whether the Entered Number is Even or Odd
static void Main(string args)
Console.Write("Enter a Number : ");
i = int.Parse(Console.ReadLine());
if (i % 2 == 0)
Console.Write("Entered Number is an Even Number");
Console.Write("Entered Number is an Odd Number");
Here is the output of the C# Program:
Enter a Number : 25 Entered Number is an Odd Number
Sanfoundry Global Education & Learning Series – 1000 C# Programs.
If you liked this C# Program, kindly share, recommend or like below!