Hello World
In this page:
Hello World
Every C# program starts execution in a Main method inside a class. Console.WriteLine prints text to standard output followed by a newline. This is the traditional first program used to confirm your setup works.
Note: The using System; line imports the namespace that contains Console.
Example: Hello World
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
Login to try C/C++/Java/PHP code in the editor
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: