Every programmer in history has started with "Hello, World!" — it's a tradition dating back to 1978 when Brian Kernighan wrote it in a C programming tutorial. Now it's your turn!
But we're not just going to print one line. A real architect announces their project and their vision. Let's learn how C# handles text output.
C# gives you two megaphones for printing text:
Console.WriteLine("text") — prints text and then moves to a new line (like pressing Enter after speaking)Console.Write("text") — prints text but stays on the same line (like continuing to talk without pausing)Watch the difference:
In the previous exercise, we cheated a little — we just wrote a single line. But a real C# program has structure, like a real building has a foundation. Here's the basic skeleton:
Think of it like this:
using System; — You're grabbing your toolbox. The System namespace contains Console and many other essential tools.class Program — Every C# program lives inside a class. It's like the blueprint folder for your building.static void Main() — This is the entry point — the front door of your program. When you run your app, this is where execution begins.{ } — Curly braces define code blocks. Everything between them belongs together, like rooms inside a building.; — forget it and C# will complain!"like this" — single quotes are for individual characters.Console is NOT the same as console.Main must have a capital M — it's the official entry point name.