Program to print inverted Pyramid star pattern in php
Inverted Pyramid star pattern in php
Example :-
<?phpecho "<pre>";$n =10;for($a=10; $a>0;$a--){ for($b=$n-$a; $b>0; $b--) echo " ";for($b=2*$a-1; $b>0; $b--)echo " *";//change only echo ""; value //for example :- 1,d,4,h,9,...etcecho"<br>";}echo"</pre>";?>
Inverted Pyramid star pattern in php
<?php
echo "<pre>";
$n =10;
for($a=10; $a>0;$a--)
{
for($b=$n-$a; $b>0; $b--)
echo " ";
for($b=2*$a-1; $b>0; $b--)
echo " *";
//change only echo ""; value
//for example :- 1,d,4,h,9,...etc
echo"<br>";
}
echo"</pre>";
?>
Output :-
2] Inverted Pyramid star pattern in php
Example :-
<?php
echo "<pre>";
$n =10;
for($a=10; $a>0;$a--)
{
for($b=$n-$a; $b>0; $b--)
echo " ";
for($b=2*$a-1; $b>0; $b--)
echo (" A");
//change only echo ""; value
//for example :- 1,d,4,h,9,...etc
echo"<br>";
}
echo"</pre>";
?>
Post a Comment