Challenge 2: Count Iterations of a Loop Until a Condition
Practice controlling loops in Rust by writing a while loop that repeatedly decreases a variable by three until it is less than zero. Learn to track and print the number of loop iterations, strengthening your understanding of loop logic and mutable variables in Rust.
We'll cover the following...
We'll cover the following...
Problem Statement
-
A variable
xis provided to you. -
Repeatedly decrease the value of the variable
xby 3 each time, as long asxis greater than or equal ...