Q. What is the output of this code?
Code:
fn main() {
let mut x = 5;
x += 1;
println!("{}", x);
}
β
Correct Answer: (B)
6
Explanation: The variable 'x' is mutable and incremented by 1, resulting in 6.