Hello World in C#
Copy and paste this C# Hello World example into your editor, compiler, terminal or runtime.
using System;
class Program {
static void Main() {
Console.WriteLine("Hello, World!");
}
}
About this C# example
Hello World programs are commonly used to confirm that a programming language environment is working correctly. This example gives you a simple starting point for C#.
The History of C#
C# has an interesting history and continues to be used by developers, students and organisations around the world. The language was created to solve specific technical challenges and has evolved over time through new versions, tools and community contributions. Depending on the language, it may be used for business software, web applications, scientific computing, systems programming, education or specialist industries. Learning about the origins of C# helps provide context for how it is used today and why it remains relevant. Many people begin their journey with a Hello World in C# example because it provides a simple introduction to the syntax and structure of the language. From that first program, developers often progress to larger projects and gain a deeper understanding of programming concepts. Although technologies change, C# continues to be an important part of the software development landscape and remains a valuable language to learn.
What is C# used for today?
C# is widely used today for .NET applications, business software, web development, cloud services, desktop applications, game development with Unity and enterprise systems. It was designed to be modern, type-safe and productive, with strong tooling through the .NET ecosystem. A Hello World in C# example normally introduces Console.WriteLine and the structure of a simple program. From there, learners can move into classes, methods, objects, web APIs, databases and cross-platform application development using the wider .NET platform.
Why learn C#?
Learning C# is useful for developers who want to build modern business applications, web services, cloud systems, games and Windows or cross-platform software. Its syntax is approachable for beginners while still supporting advanced software design. Writing a Hello World in C# program introduces the .NET development style and gives learners a simple starting point before exploring classes, objects, APIs, databases, asynchronous programming and application frameworks.
Explore more Hello World examples
Continue learning with more beginner-friendly Hello World examples in other programming languages.