Skip to content

More examples to Control Flow #169

@315732

Description

@315732

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions