100-exercises-to-learn-rust
100-exercises-to-learn-rust copied to clipboard
More examples to Control Flow
Hi there, I was wondering, there is no reference to else if in chapter Control flow, part 1. If you have time, could you add an example or a reference.
Something like this or direct link to read more about it Control Flow: else if
let number = 6;
if number % 4 == 0 {
println!("number is divisible by 4");
} else if number % 3 == 0 {
println!("number is divisible by 3");
} else if number % 2 == 0 {
println!("number is divisible by 2");
} else {
println!("number is not divisible by 4, 3, or 2");
}
Thank you for good project to learn Rust!