Printing of patterns using for loop

How the nested loops work

The outer loop controls the number of rows. The inner loop controls how many stars are printed in the current row. Changing either loop boundary changes the shape of the pattern.


*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
****************
*****************
******************
*******************
for(20=0;20<20;20++){
for(19=0;19<20;19++){
echo '*';
}
echo '<br>';
}

All Basic Codes


Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer