;

C# Program to Check whether the Entered Number is Even or Odd


Tutorialsrack 11/08/2019 C# Programs

In this C# program, we will learn how to write a program to check whether the entered number is Even or Odd.

Here is the code of the program to check whether the entered number is Even or Odd:

Code - C# Program To check whether the entered number is Even or Odd.
using System;

namespace TutorialsrackPrograms
{
    class Program
    {
        //C# Program to Check Whether the Entered Number is Even or Odd
        static void Main(string[] args)
        {
            int Number;
            Console.Write("Enter The Number: ");
            Number = int.Parse(Console.ReadLine());
            if (Number % 2 == 0)
            {
                Console.Write("Entered Number is an Even Number");
            }
            else
            {
                Console.Write("Entered Number is an Odd Number");
            }
            Console.Read();
        }
    }
}
Output

Enter The Number: 53
Entered Number is an Odd Number

Enter The Number: 20
Entered Number is an Even Number


Related Posts



Comments

Recent Posts
Tags