Write a Program to create given pattern with * using for loop

Description:
Write a Program to create following pattern using for loops:

*
**
***
****
*****
******
*******
********

Rules

  • You can use for or while loop
  • You can use multiple (nested) loop to draw above pattern

View Solution/Program using two for loops

<?php  
for($row=1;$row<=8;$row++)  
{  
   for ($star=1;$star<=$row;$star++)  
    {  
     echo "*";   
     }  
 echo "<br>";  
}  
?>
Tutorials Class - Output Window

*
**
***
****
*****
******
*******
********


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.