php program to print half diamond pattern
php program to print half diamond pattern
php program to print half diamond pattern
Example :-
<?php
for($i=5;$i>=1;$i--)
{
if($i%2!=0)
{
for($j=5;$j>=$i;$j--)
{
echo "*";
}
echo"<br>";
}
}
for($i=2;$i<=5;$i++)
{
if($i%2!=0)
{
for($j=5;$j>=$i;$j--)
{
echo "*";
}
echo "<br>";
}
}
?>
php program to print half diamond pattern
Post a Comment