^^One to ten. Sum one to ten.

E' un classico primo programma.

I primi programmi.

 

 

  1. js_one_to_ten.htm  testo nudo, solo script
  2. one to ten.htm  scritto nella canvas html
  3. Draw rectangles, 1 to 10 cicle.
  4. js_one_to_ten_sum.htm

 

javascript

total = 0
for( i=1; i<=10; i++ ) {
    total = total+i
}

 

java

total = 0;
for(i = 1;  i ≤ 10; i++)
    total = total+i;
 

haskell

sum[1..10]