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 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).
You might also like to view...
Suppose that statement2 throws an exception of type Exception2 in the following statement:
``` try { statement1; statement2; statement3; } catch (Exception1 ex1) { } catch (Exception2 ex2) { } catch (Exception3 ex3) { Statement4; throw; } statement5; ``` Which statements are executed after statement2 is executed? A. statement2 B. statement5 C. statement1 D. statement4 E. statement3
Read a series of numbers, and determine and display the largest number. The first num- ber read indicates how many numbers should be processed.
What will be an ideal response?
In the accompanying figure of a Microsoft Word 2016 document, which of the following is Box A pointing to??
?
A. ?A grammatical error B. ?A word flagged as misspelled C. ?A translation D. ?A word preceded by extra spaces
A ________ is a built-in combination of colors and fonts
A) Form Wizard B) template C) theme D) control