Monday, 30 December 2013

Find Odd and Even using Console Application in C#

Ans:-

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

namespace Logicals
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter Number Only..");
            int num = int.Parse(Console.ReadLine());
            if (num % 2 == 0)
            {
                Console.WriteLine("It's a Even No..");
            }
            else
            {
                Console.WriteLine("Its a Odd No..");
            }
            Console.ReadLine();
        }
    }
}

No comments:

Post a Comment