AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

While Loops

APCSA-KGLV8X

Consider the following code segment.

 int limit = 8;
 System.out.print("H");
 int loopcount = 10;
 while (loopcount <= limit)
 {
  System.out.print("E");
  loopcount++;
 }

 System.out.print("LLO");

What is printed as a result of executing the code segment?

A

HELLO

B

HEELLO

C

HLLO

D

HEEELLO

E

H