C# Mastery Hub
Home
Challenges
Discussion
Lessons
Core Topics
C# Fundamentals
Console Applications
Classes & OOP
Windows Forms
ASP.NET Core
SQL Server
VS & SQL Connection
RDLC Reports
.NET MAUI
Getting Started
Getting Started
Website Development
SEO Guide
Security
Project Workflow
Extra Topics
Cloud & Deployment
AWS Cloud
Deployment
About
Contact
Test Your Knowledge
C# Fundamentals - Lesson 5: Control Flow Quiz
Answer all questions to test your understanding
1
What does the if statement do in C#?
Executes code based on a condition
Repeats code multiple times
Defines a new variable
Creates a new class
2
Which statement is best for multiple condition checks?
if-else if
switch
while
for
3
What does the break keyword do in a switch statement?
Continues to next case
Exits the switch block
Restarts the switch
Skips the current iteration
4
What is the ternary operator syntax in C#?
condition ? true_value : false_value
condition : true_value ? false_value
true_value ? condition : false_value
condition ? false_value : true_value
5
What does the default case do in a switch statement?
Handles all unmatched values
Handles only the first value
Exits the switch
Throws an exception
Submit Quiz