diff --git a/Programming/Rust/Chapter 3 - Common Programming Concepts.md b/Programming/Rust/Chapter 3 - Common Programming Concepts.md index 13ef6e4d8..9f37d245a 100644 --- a/Programming/Rust/Chapter 3 - Common Programming Concepts.md +++ b/Programming/Rust/Chapter 3 - Common Programming Concepts.md @@ -166,3 +166,20 @@ I can use this multiple line comment */ ``` # 3.5 Control Flow +## `if` Statements +If statements in Rust are expressions, that optionally have else and else if +statements. + +```Rust +if number > 5 { + println!("Yay!") +} else if number < 4{ + println!("Boo!") +} else { + println!("Just right!") +} +``` +Conditions for if statements *must* return Boolean types. + +## Repetition with Loops +