Tuesday, June 7, 2016

HELLO WORLD!

This is my first post. Hence decided to go with the forever famous "Hello world" program :P

I started my career as a developer with this famous program. Here it goes.

Q: Console application to display "Hello World" on the screen.

Program:

using System;

namespace MyFirstApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.ReadKey();
        }
    }
}

Output:



Note: Console.ReadKey has its own advantages. Without Console.ReadKey, the window closes as you run the program which will otherwise keep the window open.

Happy Coding!

No comments:

Post a Comment