lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 13
How many times will the loop body execute?
int x = 3; while (x >= 1) { x -= 1; }
A. 2
B. 1
C. Infinite
D. 3
The subtraction assignment operator (-=)
An expression using the -= assignment operator, such as x -= y is equivalent to x = x - y.
Links:
The while Statement
The Subtraction Assignment Operator