C# for Beginners
From your first program to classes, structs, records, exceptions, lambdas and LINQ.
Tests check every exercise: in your browser and in the cloud
The course has no tasks to solve on the site: you practise with quizzes and by running the lesson examples yourself. To run them on your computer, set it up in two steps.
Install the .NET 10 SDK
The lessons use C# 14, which comes with the .NET 10 SDK. Install the SDK, not only the runtime.
- Download the installer for your system from dotnet.microsoft.com/download/dotnet/10.0 and run it.
- The guide File-based apps shows how to run a single
.csfile, the way every lesson example is written.
Install an editor
Pick one of the two.
- VS Code with the C# Dev Kit extension works on Windows, macOS and Linux.
- Visual Studio Community is a free all-in-one editor for Windows.
Syllabus
- if and elseTheory
- Quiz — else if orderQuiz
- The switch statementTheory
- Quiz — case without breakQuiz
- The switch expressionTheory
- while and do-whileTheory
- The for loopTheory
- Quiz — a sum in a loopQuiz
- break and continueTheory
- Quiz — continueQuiz
- Nested loopsTheory
- Quiz — break in a nested loopQuiz
- Exercise: is it primeExercise