C# Exercises
Exercises
Test your C# skills with exercises from all categories:
Syntax
Output
Comments
Variables
Constant Variables
Display Variables
Multiple Variables
Identifiers
Data Types
Type Casting
User Input
Arithmetic Operators
Arithmetic Operators
Comparison Operators
Logical Operators
Math
Strings
String Concatenation
String Interpolation
Access Strings
Special Characters
Booleans
If
Else
Else if
Shorthand if else
Switch
While Loop
For Loop
Break and Continue
Arrays
Array Loops
Sort Arrays
Multidimensional Arrays
Methods
Method Parameters
Default Parameter
Return Values
Method Overloading
OOP
Classes and Objects
Multiple Objects
Class Members
Constructors
Access Modifiers
Properties
Inheritance
Polymorphism
Abstraction
Interface
Enums
Files
Exceptions
Log in to track your progress
If you haven't already, sign up to become a W3Schooler, and get points for every exercise you complete.
As a logged on W3Schools user you will have access to many features like having your own web page, track your learning progress, receive personal guided paths, and more.
The Exercise
The exercises are a mix of "multiple choice" and "fill in the blanks" questions. There are between 3 and 9 questions in each category. The answer can be found in the corresponding tutorial chapter. If you're stuck, or answer wrong, you can try again or hit the "Show Answer" button to see the correct answer.
If you don't know C#, we suggest that you read our C# Tutorial from scratch.