C# has its roots in C and C++ and many constructs are identical.

The using System; statement is similar to #include directive in C/C++: it indicates that the program uses classes from the System library. The class Console is part of the System library and one of its methods is WriteLine(). The fully qualified call to it would look like this:

System.Console.WriteLine("Your program starts here");

The static method Main() is the entry point into your application. It is also the exit point from your application. In this case it is declared as void. If you wish to return a value to another process use the following declaration:

public static int Main()
{
    int nRC = 0;
     // Body...
   return(nRC);
}

Your application can also accept arguments:

public static void Main(string[] args)
{
   
}

Main() must be declared as part of a class. Unlike C/C++, C# does not support globally declared methods or variables.

Continue...