NOTE: THIS TUTORIAL IS KINDA CONTINUED FROM MY PREVIOUS TUT. Click here to view my previous tut.

As usual we start off with the simplest program - Hello, World!

Code: 
public class Hello
{
     public static void Main(string[] args)
     {
       System.Console.WriteLine("Hello, World! \n");
     }
}
System.Console.WriteLine()

Console is a class that belongs to the System namespace. A namespace is a collection of classes. The System namespace contains the method WriteLine(), which displays the enclosed text on the screen. The Console class has other methods, which are used for various input/output operations. The character (.) is used to access the function, WriteLine(), which is coded in the Console class of the System namespace.

The preceding line can also be written as Console.WriteLine() if the statement using System is included as the first line of the code.

The Escape Characters

To display special characters such as the New line character or the backspace character, you need to use escape characters.

I have listed the escape characters used in C# :

\' - Single quotation mark
\" - Double quotation mark
\\ - Backslash
\0 - NULL
\a - Alert
\b - Backspace
\f - Form feed
\n - New line
\r - Carriage return
\t - Horizontal tab
\v - Vertical tab
iFlames Reviewed by iFlames on . Write your first C# program! NOTE: THIS TUTORIAL IS KINDA CONTINUED FROM MY PREVIOUS TUT. Click here to view my previous tut. As usual we start off with the simplest program - Hello, World! public class Hello { public static void Main(string args) { System.Console.WriteLine("Hello, World! \n"); } Rating: 5