...

/

Untitled Masterpiece

This lesson gives a detailed solution review of the challenge in the previous lesson.

Solution:

Rust 1.40.0
fn test(_a:i32) {
// check divisibility by 2
if _a % 2 == 0 { // execute if divisible
println!("Number {} is even", _a);
}
else { // execute if not divisible
println!("Number {} is odd", _a);
}
}

Explanation

Note: The statement a % b ...

svg viewer