JavaScript tutorial 72 – Print patterns of numbers and stars




Print patterns of numbers and stars:
Displaying stars in rows and columns using Javascript loops:

var rows=5;
var cols=5;

for(var i=1;i<=rows;i++)
{
for(var j=1;j<=cols;j++)
{
document.write(” * “);
}
document.write(“<br/>”);
}

Output:
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *

========================================================

Follow the link for next video: https://youtu.be/ItOmYp9AKOA

Follow the link for previous video: https://youtu.be/3PAkBfYysio

========= For more benefits & Be up to date ===================
Subscribe to the channel:
https://www.youtube.com/chidrestechtu…

Like the Facebook fan page:
https://www.facebook.com/ManjunathChidre

Visit to Chidre’s Tech Tutorials website:
http://www.chidrestechtutorials.com

========================================================

Original source


8 responses to “JavaScript tutorial 72 – Print patterns of numbers and stars”

Leave a Reply