36 lines
739 B
Rust
36 lines
739 B
Rust
fn main() {
|
|
let x = 5;
|
|
let number = 8;
|
|
let mut y = 5;
|
|
println!("Hello, world!");
|
|
println!("X: {}", x);
|
|
|
|
println!("Y: {}", y);
|
|
|
|
y = 12;
|
|
println!("Y has been set to: {}", y);
|
|
|
|
if y < 11 {
|
|
println!("Y is less than 11: Y is {}", y);
|
|
} else {
|
|
println!("Y is more than 11: Y is {}", y);
|
|
}
|
|
|
|
y = 6;
|
|
println!("Y has been set to: {}", y);
|
|
if y < 11 {
|
|
println!("Y is less than 11, Y is {}", y);
|
|
}
|
|
|
|
if number % 4 == 0 {
|
|
println!("Y is divisible by 4");
|
|
} else if number % 3 == 0 {
|
|
println!("Y is divisible by 3");
|
|
} else if number % 2 == 0 {
|
|
println!("Y is divisible by 3");
|
|
}
|
|
println!("Y has been changed to: {}", y);
|
|
|
|
|
|
}
|