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
PHP Loops
Exercises & Assignments
Write a program to count 5 to 15 using PHP loop
Write a factorial program using for loop in php
Factorial program in PHP using recursive function
Write a program to create Chess board in PHP using for loop
Write a Program to create given pattern with * using for loop
Interview Questions & Answers
No Content Found.