Triangle in JavaScript

Learn how to print triangle in javaScript

<html>
<body>
<center>
<script type=”text/javascript”>

var i,j,k;

for(i=1;i<100;i++)
{
for(j=0;j<i;j++)
{
document.write(“*”);
}
document.write(“<br>”);
}

</script>
</center>
</body>
</html>

 

Share

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.