Modern, typed, productive
C#
C# is a statically typed, object-oriented language that runs on .NET. It powers web services written with ASP.NET Core, desktop and mobile applications, and games built in Unity, and its compiler catches many mistakes before a program runs. This curriculum starts with the beginner path (a first program, types, conditions and loops, methods, arrays and lists), moves through the intermediate path (classes, inheritance and interfaces, exceptions) and ends with the advanced path (LINQ and async). Every example targets .NET 8 and every program shown on the site has been compiled and run.
- lessons
- 3 lessons
- exercises
- 13 exercises
- interview questions
- 13 interview questions
What C# is used for
- .NET web services
- Desktop apps
- Unity games
- Enterprise software
How examples are checked
Every example and every exercise solution was run with .NET SDK 8.0 at build time. In-browser execution for C# is not available yet; the pages say so rather than pretending.
Learn
The C# learning path
Read in order: each lesson leans only on the ones before it. Every lesson ends with a small program to write and links to matching exercises.
Practice
Practise C#
13 exercises across 9 topics, each checked by running your program against test cases. Start with these:
- Bakery tray packingEasy
Read a loaf count and print how many full trays of six it fills and how many loaves remain. Practise integer division and modulo in C#.
BasicsNot started
- Conference badgeEasy
Print a three-line attendee badge from a name and an organisation, using ToUpper, string length and a repeated character. A first C# string exercise.
StringsNot started
- Garden bed areasMedium
Compute the area of rectangular, square and circular garden beds through a shared abstract base class. Inheritance and polymorphism in C#.
Classes and objectsNot started
- Locker code checkMedium
Validate gym locker codes (two capital letters then four digits) with a bool method that inspects each character. C# methods and char checks.
StringsNot started
More