Friday, May 31, 2024

Program to print reverse right Half Pyramid pattern in php


Reverse right Half Pyramid in php

1] Reverse right Half Pyramid in php 

Example :-

<?php
for($i=0;$i<=5;$i++)
{
  for($j=5-$i;$j>=1;$j--)
  {
    echo"*";
//change only  echo ""; value
    //for example :- 1,d,4,h,9,...etc
  }
  echo "<br>";
}
?>
Reverse right Half Pyramid in php

Output :-

reverse right Half Pyramid in php



1] Reverse right Half Pyramid in php 

Example :-


<?php
for($i=0;$i<=5;$i++)
{
  for($j=5-$i;$j>=1;$j--)
  {
    echo"A";
    //change only  echo ""; value
    //for example :- 1,d,4,h,9,...etc
  }
  echo "<br>";
}
?>


Reverse right Half Pyramid in php

Output :-

reverse right Half Pyramid in php





No comments:

Post a Comment