diff options
| author | Carlos Maiolino <[email protected]> | 2025-07-10 22:24:20 +0200 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-07-10 22:24:20 +0200 |
| commit | 869e68986aa8f69af6e7842260a68d1e5c6f796f (patch) | |
| tree | 63b6b5ffc3d19414233d4629a533c0d9bf3cbf72 /rust/branches/src/main.rs | |
| parent | 20834dcc57537cd95260a4a22f5d91a027adfd35 (diff) | |
Add a bunch of code
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'rust/branches/src/main.rs')
| -rw-r--r-- | rust/branches/src/main.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/rust/branches/src/main.rs b/rust/branches/src/main.rs new file mode 100644 index 0000000..450f526 --- /dev/null +++ b/rust/branches/src/main.rs @@ -0,0 +1,26 @@ +fn main() { + let number = 6; + + if number < 5 { + println!("condition was true"); + } else { + println!("condition was false"); + } + + if number % 4 == 0 { + println!("Divisible by 4"); + } else if number % 3 == 0 { + println!("Divisible by 3"); + } else if number % 2 ==0 { + println!("Divisible by 2"); + } else { + println!("Shit hit the fan"); + } + + let condition =true; + let x = if condition { 5 } else { 6 }; + println!("The value of number is: {x}"); + + // This code Kabooms + // let foo = if condition { 6 } else { "seven" }; +} |
