How can write a Console program in C# ?

Total Post:46

Points:324

C# 
C#
 511  View(s)
Ratings:
Rate this:
Please give me some examples for Practices.
  1. Re: How can write a Console program in C# ?

    Given number is Odd or Even...

    How can write a Console program in C# ?

    using System.Text;
    
    using System.Threading.Tasks;

    namespace ConsoleApplication10
    {
        class Program
        {
            static void Main(string[] args)
            {
                int j;
                Console.Write("Please Enter a Number : ");
                j = int.Parse(Console.ReadLine());
                if (j % 2 == 0)
                {
                    Console.Write("Entered Number is an Even Number");
                    Console.Read();
                }
                else
                {
                    Console.Write("Entered Number is an Odd Number");
                    Console.Read();
                }
            }
        }
    }


Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.