Professional Documents
Culture Documents
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?