Display text
Let's analyze a program that displays the phrase "Hello, world!"
using System;
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Hello World!");
    }
}

Let's take it in order:

using System; - The using directive includes the System namespace, which defines the entire C# standard library.

class Program {...} and static void Main() {...}  have already been explained in previous tasks.

Console.WriteLine("Hello World!"); - method that displays text in the console window. After it is executed, the cursor moves to the next line.

Output operator  to the screen in C#

There are two similar methods in C#:  Console.Write() and  Console.WriteLine()Both output text to the console. The only difference between them is that the first method leaves the cursor on the line, while the second moves it to the next line.

Special characters

Many programming languages have special characters that just can not be output.
For example, commonly used special characters are backslash (\), quotation marks (") and apostrophes (')
Note that a regular slash (/) is not a special character!

To output such characters, we put a \ in front of each of them. That is, if we want to display the sign \, then in the output operator it is necessary to write \\

 
REMEMBER
To display the characters \, ", ', you must put a \ in front of them

Let's practice!