Skip to content
Codewilds

Lesson 7 of 34 · Fundamentals

Quiz: C# Fundamentals

Quizeasy10 XP1 min readFree lesson

Time to check what you've learned in the Fundamentals chapter: C#'s numeric types, integer vs decimal math, string interpolation, decisions with if and switch, and loops.

Read each question carefully — several of them are classic traps that catch even experienced developers coming to C# from other languages. If you miss one, the explanation shows you why, and you can revisit the lesson before facing the chapter boss.

What this quiz covers

The questions check what you learned in the Fundamentals chapter of Learn C#. Not sure about a topic? Review its lesson first:

  • C# Hello World: Your First Program

    Write your first C# program with Console.WriteLine and top-level statements. Compile and run real C# in your browser — no Visual Studio or .NET SDK needed.

  • C# Variables and Data Types

    Learn C# variables and data types — int, double, decimal, bool, char, string and var — with conversions, constants and the mistakes beginners make most.

  • C# Strings and String Interpolation

    Master C# strings: string interpolation with $, format specifiers, escape sequences and essential methods like Trim, ToUpper, Replace, Substring and Split.

  • C# Operators: Arithmetic, Comparison and Logic

    Learn C# operators: arithmetic, integer division, the % remainder, compound assignment, the Math class, comparisons and the logical operators && || and !.

  • C# if/else, switch and Switch Expressions

    Make decisions in C# with if, else if and else, the ternary operator, the switch statement and modern switch expressions with relational patterns.

  • C# Loops: for, while, do-while and foreach

    Repeat code with C# loops: the for loop, while and do-while, foreach over strings, break and continue — plus how to avoid off-by-one errors.

Keep learning

Need a quick reminder? The C# cheat sheet has every topic of Learn C# on one page.

Lesson last updated on .

Take the quiz ↓
Quiz+10 XP
Question 1 of 60/6 correct

What does Console.WriteLine(7 / 2); print?