Declaring and manipulating variables in programming is a fundamental concept that allows you to store and modify data. Variables in Rust are immutable by default, but you can make them mutable using the mut
keyword.
In this challenge, you will declare and use mutable variables in Rust. You will be given a function where you need to declare variables, modify their values, and perform specific operations.
text
with an initial value of "hello"
. Use let mut
to make it mutable.text
to something else of your choice.The println!
macro is used to print text to the console. It is similar to the println
function in other programming languages. The println!
macro is used to print formatted text to the console.
The {}
is a placeholder that will be replaced by the value of the variable text
.
let mut
keyword to declare a mutable variable.=
operator.