COMP 14



COMP 110

Loop and array self-help exercises: Answers

1. Write a loop to display the integers 0 through 9 in ascending order.

for (var i=0; i=0; i--)

{ alert(i);}

3. Write a loop to sum the integers 0 through 100.

var sum = 0;

for (var i=0; i ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download