Created
April 8, 2022 18:42
-
-
Save jcar787/5f925f5d5c7cde9744330b430f319369 to your computer and use it in GitHub Desktop.
Example of if statements in rust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let i = 8; | |
if i > 5 { | |
println!("{} is greater than 5", i); | |
} | |
if i < 8 { | |
println!("This line is not going to run"); | |
} else { | |
println!("But this does because its {}", i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment