Skip to content

Instantly share code, notes, and snippets.

@jcar787
Created April 8, 2022 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcar787/5f925f5d5c7cde9744330b430f319369 to your computer and use it in GitHub Desktop.
Save jcar787/5f925f5d5c7cde9744330b430f319369 to your computer and use it in GitHub Desktop.
Example of if statements in rust
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