Accenture Java Programming Practice Question
What is the output of this program? 1. class Crivitch { 2. public static void main(String [] args) { 3. int x = 10; 4. 5. do { } while (x++ < y); 6. System.out.println(x); 7. } 8. } Which statement, inserted at line 4, produces the output 12?Answer options
A
int y=11;
B
int y=12;
C
int y=13;
D
int y=10;
Correct answer: int y=11;
Explanation
Correct answer: int y=11;.