php program to print hollow triangle star pattern
php program to print hollow triangle star pattern
Example :-
<?php
$size =5;
for($i=1;$i<=$size;$i++)
{
for($j=0;$j<$i;$j++)
{
if($i!=$size)
{
if($j==0||$j==$i-1)
{
echo '*';
}
else{
echo " ";
}
}
else{
echo'*';
}
}
echo '<br>';
}
?>
php program to print hollow triangle star pattern
Output:-
Related Post :-
Post a Comment