Topic Overview

Welcome! Today, we're exploring C#'s special instructions: Conditional Looping, along with the break and continue statements. As we know, loops enable code to execute multiple times. Conditional looping, enhanced with break and continue, bolsters loop control, leading to flexible, efficient code. Grab your explorer hat, and let's get started!

The 'if' Statement

C#'s if statement sets condition-based actions for our code. Consider this simple example where the if statement decides which message to print based on the value of temperature:

We can also evaluate multiple conditions using else if. In other words, "If the previous condition isn't true, then check this one":

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal