You are on page 1of 1

Name:

Usethecodebelowtoanswerthe
questionsthatfollow:

varMIN=1;
varMAX=13;

functionstart(){

varsum=0;

for(vari=MIN;i<=MAX;i++){

sum=sum+i;

println("Thesumwas"+sum);
}

1. Whatisthestartingvalueofiin
theaboveforloop?

2. Whereisthestartingvalueinthe
codeabove?

3. Whatisthemaximumvalueofi?

4. Whereisthemaximuminthecode
above?

5. Howareweincrementingi?

6. Whereisthisincrementinthe
codeabove?

7. Completethetablecalculatingthe
valueofsumforeachi:

sum=
sum+i

sum

8. Whatwillbeprintedwhenyourun
thiscode?

You might also like