What is y after the following for loop statement is executed?
```
int y = 0;
for (int i = 0; i < 10; ++i) {
y += 1;
}
```
A. 9
B. 10
C. 11
D. 12
B. 10
Before the loop, y is 0. The loop is executed 10 times. Each time, 1 is added to y. So, after the loop is finished, y is 10. The correct answer is (B).
Computer Science & Information Technology
You might also like to view...
In C#, you declare an output parameter by writing the ____________ keyword before the parameter variable's data type.
a. public b. ref c. const d. out
Computer Science & Information Technology
A ____ is a document that outlines specific requirements or rules that must be met.
A. policy B. standard C. guideline D. risk
Computer Science & Information Technology
The last statement in a method is a(n) ____.
A. begin statement B. return statement C. exit statement D. end statement
Computer Science & Information Technology
?How does CORS work?
What will be an ideal response?
Computer Science & Information Technology