From 2ab617a43604ba138ee15dc04754b02202c039c4 Mon Sep 17 00:00:00 2001 From: Juliano Penna Date: Fri, 7 Feb 2025 11:47:41 -0300 Subject: [PATCH] Add new solution in variables ex. 4 --- solutions/variables.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/solutions/variables.md b/solutions/variables.md index bedd84f..f1ec8aa 100644 --- a/solutions/variables.md +++ b/solutions/variables.md @@ -35,6 +35,17 @@ fn main() { 4. +```rust +fn main() { + define_x(); +} + +fn define_x() { + let x = "hello"; + println!("{}, world", x); +} +``` + ```rust fn main() { let x = define_x(); @@ -141,4 +152,4 @@ fn main() { // fill the blank to make the code work assert_eq!([x, y], [3, 2]); } -``` \ No newline at end of file +```