Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More examples to Control Flow #169

Open
315732 opened this issue Oct 11, 2024 · 0 comments
Open

More examples to Control Flow #169

315732 opened this issue Oct 11, 2024 · 0 comments

Comments

@315732
Copy link

315732 commented Oct 11, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant