Codeloft
0 0 XP

Hello, C#

6 min 20 XP + 10 for no hints

A C# program starts in a method called Main. Console.WriteLine() prints text and then moves to a new line.

using System; lets you write Console instead of the full name System.Console. Curly braces group code into blocks.

Newer C# can skip the class and Main lines, but you'll meet this classic shape in most code you read.

Example (inside Main)
Console.WriteLine("Hi!");
Console.Write("2 + 3 = ");
Console.WriteLine(2 + 3);
Output
Hi!
2 + 3 = 5
Console.Write() prints without moving to a new line.

Your tasks

0 of 3 done
  1. Change the message to introduce yourself
  2. Print a second line with Console.WriteLine
  3. Use Console.Write once

Quick check

What is the difference between Write and WriteLine?

Program.csChecked as you type
No problems found. Unclosed tags, missing semicolons and errors show up here in plain words.