Skip to content

Exercise path · C#

10 C# exercises, in order

From your first line to a complete program you assembled yourself. Each exercise introduces exactly one new idea, runs in this tab, and tells you in plain language what happened.

How the path works

You never start from a blank editor. Every exercise hands you a program that already runs and asks you to change or add one thing, so the first success is minutes away and the last exercise is a program you can read top to bottom and explain. The ideas arrive in this order: variables & output, conditionals, loops, reading input, arrays, lists, linq, dictionaries, putting it together.

Run is the check. There is no separate submit button: press Run, and the output is compared with what the exercise asked for. When it is not right, the feedback is a sentence about what happened — the line that differed, or what the error means — rather than a verdict. Hints come one at a time, and the answer opens only after you have run your code at least once, because reading the answer first is how you learn nothing.

Your finished exercises and the code you last had in the editor are saved in this browser, so a half-done exercise is still there tomorrow. Nothing is uploaded and there is no account.

The exercises

  1. Coat Check Claim TicketA small console program that prints a coat-check claim ticket with a claim number, an item description, and a rack number.New idea: Declaring typed variables and printing their values with string interpolation
  2. Spelling Test Pass CheckerA program that takes a student's spelling test score and prints whether they passed.New idea: Branching with if/else based on a comparison
  3. Ferris Wheel Car NumberingA program that prints a numbered list of ferris wheel cars along with how many seats each one has.New idea: Repeating a block a fixed number of times with a for loop
  4. Vending Machine RestockA program that restocks a vending machine slot one item at a time until it reaches capacity.New idea: Repeating a block with a while loop until a condition becomes false
  5. Airport Security Line StatusA program that reads how many minutes a traveler waited in a security line and prints a status label for it.New idea: Reading a line from the console and parsing it into a number
  6. Chess Club Weekly AttendanceA program that stores a week of chess club attendance counts in an array and prints each night's count plus the total.New idea: Storing multiple values in an array and looping over it safely by index
  7. Household Chore RotationA program that builds a rotating list of household chores by adding names and prints whose turn is next.New idea: Using a List<string> to add items dynamically and read its Count
  8. Craft Fair Booth SalesA program that filters a craft fair vendor's sales to the ones above a minimum amount and totals just those.New idea: Using LINQ's Where and Sum to filter and total a list
  9. Town Hall Attendance by DistrictA program that tracks how many residents from each district signed in to a town hall meeting and prints a per-district report.New idea: Using a Dictionary<string,int> and ContainsKey to look up values safely by key
  10. Summer Camp Swim Test ResultsA program that goes through a list of campers' swim test lap counts, labels each as 'cleared' or 'not yet', and prints a summary report.New idea: Combining lists, loops, and conditionals while avoiding integer-division truncation

After the path

The C# playground is where to build something of your own, and the C# guide sets out a learning order for everything after the basics. Everything you can practise C# with on this site is gathered on the C# practice hub. The same path also exists in Python, JavaScript, TypeScript, Java, C++, C, Go, PHP, Ruby, SQL, R and Bash & the Shell.