Quiz: Rust Basic Concepts
Test yourself on what you have learned so far in this chapter.
1
What is the output of the following code snippet?
let mut counter = 0;
while counter < 5 {
println!("{}", counter);
counter += 1;
}
A)
1
2
3
4
5
B)
0
1
2
3
4
C)
The loop will run infinitely.
D)
The loop won’t run even once.
Question 1 of 50 attempted
Get hands-on with 1400+ tech skills courses.