Hello World and Program Structure
Understand the entry point and the structure of a C# console program.
Introduction
A C# application starts in Main. The using directive makes framework types available without fully qualified names.
Main is static because the runtime calls it before an object exists. Console.WriteLine writes a line to standard output.
Runnable C# example
Program.cs
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, C#!");
}
}
Hello, C#!Practice with the debugger
Set a breakpoint on an important assignment or condition, click Debug, and inspect the local values before stepping to the next line.
Practice with a challenge
Use what this lesson covers to solve a real problem. Each challenge runs in your browser with instant tests and an AI review.
All challenges