P5 To find whether the given number is odd or even

    class Program
    {
        static void Main(string[] args)
        {
            int n;
            Console.Write("Enter the number : ");
            n = int.Parse(Console.ReadLine());
            if (n % 2 == 0)
            {
                Console.WriteLine("The Number is Even");
            }
            else
            {
                Console.WriteLine("The Number is Odd");
            }
            Console.ReadLine();
        }
    }

Output 1 :


Output 2 :

No comments:

Post a Comment