Start(variables): intro & variables progress

This commit is contained in:
2026-07-03 13:25:21 +02:00
parent fafdaca47f
commit 2b8273fd55
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
fn main() { fn main() {
// TODO: Fix the code to print "Hello world!". // TODO: Fix the code to print "Hello world!".
printline!("Hello world!"); println!("Hello world!");
} }
+1 -1
View File
@@ -1,6 +1,6 @@
fn main() { fn main() {
// TODO: Add the missing keyword. // TODO: Add the missing keyword.
x = 5; let x = 5;
println!("x has the value {x}"); println!("x has the value {x}");
} }
+1 -1
View File
@@ -1,6 +1,6 @@
fn main() { fn main() {
// TODO: Change the line below to fix the compiler error. // TODO: Change the line below to fix the compiler error.
let x; let x: i32 = 65;
if x == 10 { if x == 10 {
println!("x is ten!"); println!("x is ten!");
+1 -1
View File
@@ -1,6 +1,6 @@
fn main() { fn main() {
// TODO: Change the line below to fix the compiler error. // TODO: Change the line below to fix the compiler error.
let x: i32; let x: i32 = 52;
println!("Number {x}"); println!("Number {x}");
} }
+1 -1
View File
@@ -1,6 +1,6 @@
// TODO: Fix the compiler error. // TODO: Fix the compiler error.
fn main() { fn main() {
let x = 3; let mut x = 3;
println!("Number {x}"); println!("Number {x}");
x = 5; // Don't change this line x = 5; // Don't change this line