C# Foundations · Lesson 1

First program

A console program starts in Program.cs and runs from the top.

How it works

Top-level statements run in order. The first WriteLine prints Hello, SharpRune! and the second line prints only after that. Check looks for problems in the current text. Run executes a snapshot on this device and does not keep going if you edit afterwards.

A working example

Console.WriteLine("Hello, SharpRune!");
Console.WriteLine("The next line runs after that.");

Expected output

Hello, SharpRune!
The next line runs after that.
Try this
Start with one WriteLine, then add a second.