Limited access

Upgrade to access all content for this subject

List Settings
Sort By
Difficulty Filters
Page NaN of 1946

Consider the following code segment.

int c=0, s=0;

while(true)
{
    s+=c;
    if (s>20)
    {
        break;
    }
    c+=4;
}
System.out.println(s);

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

A

24

B

20

C

12

D

8

E

4

Accuracy 0%
Select an assignment template