. . .

Print a star pyramid with one for loop function?

javascript
Please share the article
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
<script src="js/loop.js"></script>

row=0;
while(row<=50) 
{
	col=row;
	while(col>0)	
	{
	document.write("*");
	col--;
	}
	
	while(col<50)
	{
	document.write("+");
	col++;
	}
	
row++;
document.write("</br>");
}

Leave a Reply

Your email address will not be published. Required fields are marked *

twenty + five =