Ad

php program to print half diamond pattern

 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

Output:-

php program to print half diamond  pattern



Related Post :-

php program to print triangle pattern

php array types

No comments

Powered by Blogger.