Edit

Share via

Hello World - Introductory interactive tutorial

Run your first program

Run the following code in the interactive window. Select the Enter focus mode button. Then, type the following code block in the interactive window and select Run:

C#
Console.WriteLine("Hello World!");

Congratulations! You've run your first C# program. It's a simple program that prints the message "Hello World!". It used the Console.WriteLine method to print that message. Console is a type that represents the console window. WriteLine is a method of the Console type that prints a line of text to that text console.

Let's move on and explore more. The rest of this lesson explores working with the string type, which represents text in C#. Like the Console type, the string type has methods. The string methods work with text.

Try the code in your browser