Discover the best answers at Westonci.ca, where experts share their insights and knowledge with you. Connect with a community of experts ready to help you find solutions to your questions quickly and accurately. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

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");

  }

}