Hello World Program in C#

Advertisements

Prev Tutorial Next Tutorial

Print Hello World Program in C#

This is very first program of any programming language here we write this code in C#. To display any message on screen we use WriteLine() the static method of Console class.

Print Hello World Program in C#

public class HelloWorld
{ 
  public static void Main()
  {
    Console.WriteLine("Hello World !");
  }
}

Output

Hello World !

Print Hello World Program in C# Using System

using System;

public class HelloWorld
{ 
  public static void Main()
  {
    Console.WriteLine("Hello World !");
  }
}

Output

Hello World !

Code Explanation

  • Every Main method must be contained inside a class (HelloWorld in this case).
  • The System.Console class contains a WriteLine method that can be used to display a string to the console.

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements