Q. What is the output of this code?
Code:
fn main() {
let x = 10;
let y = &x;
println!("{}", y);
}
β
Correct Answer: (A)
10
Explanation: Rust automatically dereferences references in println!, so it prints 10.