?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

Loop Tracing

APCSA-TDWYM8

Consider the following code segment.

 int length = 5;
 int count = 4;
 while (count <= 6)
 {
     if (length >= 100)
        length -= 2;
     else
        length = count * length;
     count++;
 }

What is the value of length after executing this code segment?

A

600

B

100

C

98

D

20

E

5