What is the output of the following code snippet?
Int i = 1;
While (i != 9)
{
System.out.print(i + " ") ;
I++;
If (i == 9)
{
System.out.println("End") ;
}
}
A) 1 End
B) 1 End (infinite loop)
C) 1 2 3 4 5 6 7 8 End
D) 1 2 3 4 5 6 7 8 End (infinite loop)
Correct Answer:
Verified
Q24: Which of the following code snippets displays
Q25: How many times does the following code
Q26: How many times does the loop execute
Q27: What is the output of the code
Q28: Select the statement that correctly completes the
Q30: Which of the following is considered a
Q31: What values does counter variable i assume
Q32: When hand-tracing a portion of code, which
Q33: What is the output of the code
Q34: What changes do you need to make
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents