How can write a Console program in C# ?

Total Post:19

Points:133
C# 
C#
 298  View(s)
Ratings:
Rate this:
Please give me some examples for Practices.
  1. Post:31

    Points:219
    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

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!