how to display word by a console application in C#


"Welcome to C#.net" in a console application

Here, we will create a small console application. This application will show “Welcome to C#.net” into the console display.

Steps:
  1. Start Microsoft Visual Studio 2008
  2. Click File > New > Project
You will see the following window


                                                Figure: New Project Creation Templates

  1. Select Windows > Console Application
  2. Write a name in ‘Name’ box and you can change the destination folder of the project directory by clicking the ‘Browse...’ button
  3. Click ‘OK’ button
  4. You will see the following code
        using System;
     using System.Collections.Generic;
     using System.Linq;
     using System.Text;

     namespace WalkThrough1
     {
            class Program
           {
                 static void Main(string[] args)
                {
                }
           }
     }

  1. Now write the following code snippet inside the main method
    Console.WriteLine("Welcome to C#.net");
     Console.ReadKey();
  1. Then Press F5 or Click on the Debug button
  1. Now You will see the output given below

0 comments:

Post a Comment