C# Program Structure :

Basic Program in C# Language :

  1. /* Author: techbaz.org
  2. Date: 2018-11-17
  3. Description: "Hello World" on the screen */
  4. using System;
  5. namespace DemoProgramming
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. Console.WriteLine(" \n Hello World");
  12. Console.ReadKey();
  13. }
  14. }
  15. }

Output :

C Sharp Language Hello World program

Note : C# is case sensitive and you can use '\n' for create a new line.

using System;

the using keyword is used to include the System namespace in the program. A program generally has multiple using statements.


A namespace is a collection of classes. The DemoProgramming namespace contains the class Program.


the class Program contains the data and method definitions that your program uses. Classes generally contain multiple methods. Methods define the behavior of the class. However, the Program class has only one method Main.


Main is the entry point for all C# programs. The Main method states what the class does when executed.

/* comments */

/*...*/ is ignored by the compiler and it is put to add comments in the program.


WriteLine is a method of the Console class defined in the System namespace. This statement causes the message "Hello World" to be displayed on the screen.


Console.ReadKey(); This makes the program wait for a key press and it prevents the screen from running and closing quickly when the program is launched from Visual Studio .NET.

Computer Science Engineering

Special Notes

It's a special area where you can find special questions and answers for CSE students or IT professionals. Also, In this section, we try to explain a topic in a very deep way.

CSE Notes