Learning path

C# fundamentals

From your first program to operators, input, conditions, loops, strings, arrays, collections, methods and exceptions, with a challenge after each topic.

17 lessons · 31 challenges

Start the path →

1 Getting started 4 lessons

  1. Lesson 1 challenge Hello World and Program Structure Understand the entry point and the structure of a C# console program.
  2. Lesson 2 challenges Types, Variables, and Constants Declare strongly typed values and constants in C#.
  3. Lesson 2 challenges Operators and Math Use arithmetic, assignment, comparison and logical operators in C#, plus the Math class.
  4. Lesson 2 challenges Reading Console Input Read what the user types with Console.ReadLine and convert it safely with int.TryParse.

2 Making decisions 2 lessons

  1. Lesson 2 challenges Conditions and Switch Expressions Choose behavior with if statements and concise switch expressions.
  2. Lesson 1 challenge Switch Expression Calculator Build a calculator with a C# switch expression.

3 Loops 1 lesson

  1. Lesson 2 challenges Loops and Iteration Use for, foreach, and while loops safely.

4 Strings and text 2 lessons

  1. Lesson 3 challenges Strings and Interpolation Compose and inspect text with modern C# string features.
  2. Lesson 1 challenge Invoice and Numeric Formatting Format aligned currency output with interpolation.

5 Collections 3 lessons

  1. Lesson 3 challenges Arrays Create, read, change, loop over and sort C# arrays, including 2D arrays.
  2. Lesson 2 challenges Lists and Dictionaries Store ordered values and keyed data with generic collections.
  3. Lesson 2 challenges Word Frequency Dictionary Count normalized words with Dictionary<TKey,TValue>.

6 Functions 2 lessons

  1. Lesson 2 challenges Methods, Parameters, and Tuples Define reusable methods with named results and multiple return values.
  2. Lesson 2 challenges Return Statistics with Tuples Return several named results without creating a class.

7 Errors and files 2 lessons

  1. Lesson 2 challenges Exception Handling Validate operations and recover from expected failures.
  2. Lesson 1 challenge Validate Input with TryParse Parse user input without using exceptions for ordinary validation.

8 Objects and classes 1 lesson

  1. Lesson 1 challenge Classes and Objects Model state and behavior together in a C# class.
Continue with: Programming fundamentals