Monday, March 14, 2011

Ex 2 "triangles" with strings

based on 2.2, 

var cont = 1; chain = "#"; while (cont <= 10) {
  print (chain); chain = chain +"#" ; cont = cont + 1; }

I print first to get the original "#" and then start to add more "#" on every loop and we get a rectalngle triangle.

No comments:

Post a Comment