21 lines
384 B
Rust
21 lines
384 B
Rust
fn main() {
|
|
let mut x = 0;
|
|
|
|
// If Bedingungen sind sehr ähnlich zu anderen Sprachen
|
|
if x == 0 {
|
|
println!("x ist Null");
|
|
} else if x < 0 {
|
|
println!("x ist negativ");
|
|
} else {
|
|
println!("x ist positiv");
|
|
}
|
|
|
|
while x < 10 {
|
|
println!("x ist kleiner als 10");
|
|
x += 1;
|
|
}
|
|
|
|
for i in 1..100 {
|
|
if i % 2
|
|
}
|
|
} |