Westonci.ca offers fast, accurate answers to your questions. Join our community and get the insights you need now. Ask your questions and receive accurate answers from professionals with extensive experience in various fields on our platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

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"); } } 1 End 1 End 1 End (but the loop is an infinite loop) 1 End (but the loop is an infinite loop) 1 2 3 4 5 6 7 8 End 1 2 3 4 5 6 7 8 End 1 2 3 4 5 6 7 8 End (but the loop is an infinite loop)

Sagot :

Answer:

1 2 3 4 5 6 7 8 End

Explanation:

int i = 1;

while (i != 9){

  System.out.print (i + " ");

  i ++;

  if (i == 9){

     System.out.println("End");

  }

}