diff --git a/variables/Cargo.lock b/variables/Cargo.lock new file mode 100644 index 0000000..a6daf1d --- /dev/null +++ b/variables/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "variables" +version = "0.1.0" diff --git a/variables/Cargo.toml b/variables/Cargo.toml new file mode 100644 index 0000000..f1cad76 --- /dev/null +++ b/variables/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "variables" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/variables/src/main.rs b/variables/src/main.rs new file mode 100644 index 0000000..224c129 --- /dev/null +++ b/variables/src/main.rs @@ -0,0 +1,17 @@ +fn main() { + let x = 5; + let x = x + 1; + + println!("X: {x}"); + { + let x = x * 2; + println!("x: {x}"); + } + println!("x: {x}"); + + let fx = 2.0; + let fy : f32 = 3.0; + println!("fx: {fx}"); + println!("fy: {fy}"); + +}