Monday, March 14, 2011

Ex 2.2 2 to the 10th power

Using while it goes like this...

var power = 1; value = 2; while (power <= 10) {
  value = 2 * value
  show (value);  
  power = power 1; }

2 vars, one for control and the other one to show the result.

No comments:

Post a Comment