Skip to main content

2 docs tagged with "else"

View all tags

Conditional Statements: `if-else if-else` (Part 2)

In the previous article, we learned the basics of if-else expressions. This is great for handling a single condition, but what if you have multiple conditions you want to check? For this, Rust provides the else if expression.

Conditional Statements: `if-else` expressions (Part 1)

Welcome to our fourth series! Now that you've built some complete console applications, it's time to dive deeper into one of the most fundamental concepts in programming: control flow. Control flow allows you to run different blocks of code based on certain conditions. The most common way to do this is with if expressions.