Lesson contents

Environment setup

Install the tools from the official guide. Save this program with the filename above the code, then run the command shown below. Seeing the number on screen means your first program ran.

Official installation guide

Simple example

Print a number.

Start1
Result1
Program.cs
using System;

Console.WriteLine(1);
Output
1
Advertisements

Everyday examples

The school fair has a screen at the entrance. Test it by showing the number of the first ticket.

Start101
Result101
Program.cs
using System;

Console.WriteLine(101);
Output
101
Run the example
Terminal
dotnet new console --output Lesson
cp Program.cs Lesson/Program.cs
dotnet run --project Lesson
Official documentation