find the even or odd number enter by the user in c# program

find the even or odd number enter by the user in c#  program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace even_Odd
{
    class Program
    {
        static void Main(string[] args)
      
        {
             int i;
             Console.Write("Enter a Number : ");

             i = int.Parse(Console.ReadLine());

            if (i % 2 == 0)

            {

                Console.Write("Entered Number is an Even Number");

                Console.Read();

            }

            else

            {

                Console.Write("Entered Number is an Odd Number");

                Console.Read();
        }
    }
 }

OutPut :  By following  you can check the number is even or odd



 

Previous
Next Post »