Answers for "rust if else"

2

if else Rust

// pratical example of if/else in rust
if n > 1 {
	println!("It's greater");
} else if n == 1 {
	println!("It's equal");
} else {
	println!("It's minor");
}
Posted by: Guest on February-14-2021
1

if in rust

if <boolean expression> {
		print!("result from expression is true");
	}
    else {
        print!("result from expression is false");
	}
Posted by: Guest on July-26-2020

Browse Popular Code Answers by Language