Menu
Coddy logo textTech

Hello World!

Part of the Fundamentals section of Coddy's C# journey — lesson 2 of 69.

The "Hello World!" is a simple program that outputs Hello World! to the screen.

In C#, we use Console.WriteLine() to print output to the console. The text to be printed is placed within double quotes and enclosed in parentheses.

Every C# program starts from the Main() method — it is the entry point of the program. Your code goes inside Main().

Let's take a look at the "Hello World!" program in C#:

public class Program {
    public static void Main(string[] args) {
        Console.WriteLine("Hello World!");
    }
}
challenge icon

Challenge

Beginner

Use the code view to write a program that outputs Hello World!

Note that anything inside quotation marks is case sensitive. For example:

Console.WriteLine("Hello World!");
Console.WriteLine("hello world!");

are different things (notice the capital letters in the first line).

Cheat sheet

To print to the console in C# use Console.WriteLine():

public class Program {
    public static void Main(string[] args) {
        Console.WriteLine("Hello World!");
    }
}

Try it yourself

using System;

public class Program {
    public static void Main(string[] args) {
        // Write your code below
        
        
    }
}
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals