Friday, May 31, 2024

php program to print increasing triangle

php program to print increasing triangle 


php program to print increasing triangle


php program to print increasing triangle  

Example :-

<?php
for($i=0;$i<=5;$i++){
for($j=1;$j<=$i;$j++){
echo "*";
}
echo '<br>';
}
?>

php program to print increasing triangle  

Output:-

php program to print increasing triangle


php program to print increasing triangle 

Example :- 

<?php
for($i=0;$i<=5;$i++){
for($j=1;$j<=$i;$j++){
echo "A";
}
echo '<br>';
}
?>

php program to print increasing triangle  

Output:-

right half pyramid in php program,php program to print increasing triangle,


Related Post:-

inverted pyramid star pattern in php

left pascal star pattern in php

php program to print alphabet pattern C 

php program to print alphabet pattern j

php program to print alphabet pattern m

square pattern in php

reverse right half pyramid in php

Program to print left pascal star pattern in php

left pascal star pattern in php

 left pascal star pattern in php

Example :-

<?php
    $size = 5;
   
    for ($i = 1; $i <= $size; $i++) {
        for ($j = 0; $j < $size - $i; $j++) {
            echo "&nbsp;&nbsp;";
        }
        for ($k = 0; $k < $i; $k++) {
            echo "*";
        }
        echo "<br>";
    }
    for ($i = 1; $i <= $size - 1; $i++) {
        for ($j = 0; $j < $i; $j++) {
            echo "&nbsp;&nbsp;";
        }
        for ($k = 0; $k < $size - $i; $k++) {
            echo "*";
        }
        echo "<br>";
    }
?>
left pascal star pattern in php

Output:-

left pascal star pattern in php


left pascal star pattern in php

Example :-

<?php
    $size = 5;
   
    for ($i = 1; $i <= $size; $i++) {
        for ($j = 0; $j < $size - $i; $j++) {
            echo "&nbsp;&nbsp;";
        }
        for ($k = 0; $k < $i; $k++) {
            echo "b";
        }
        echo "<br>";
    }
    for ($i = 1; $i <= $size - 1; $i++) {
        for ($j = 0; $j < $i; $j++) {
            echo "&nbsp;&nbsp;";
        }
        for ($k = 0; $k < $size - $i; $k++) {
            echo "b";
        }
        echo "<br>";
    }
?>

left pascal star pattern in php

Program to print inverted Pyramid star pattern in php

Inverted Pyramid star pattern in php

 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 "&nbsp;&nbsp;";
for($b=2*$a-1; $b>0; $b--)
echo "&nbsp;*";
//change only  echo ""; value
    //for example :- 1,d,4,h,9,...etc
echo"<br>";
}
echo"</pre>";
?>

 Inverted Pyramid star pattern in php 

Output :-

inverted Pyramid star pattern in php

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 "&nbsp;&nbsp;";
for($b=2*$a-1; $b>0; $b--)
echo ("&nbsp;A");
//change only  echo ""; value
    //for example :- 1,d,4,h,9,...etc
echo"<br>";
}
echo"</pre>";
?>

 Inverted Pyramid star pattern in php 

Output :-

inverted Pyramid star pattern in php


Related Post :-

reverse right half pyramid in php

square pattern in php

PHP Program to Print Alphabet Pattern H

PHP Program to print Alphabet Pattern B

 php program to print alphabet pattern j

 php program to print alphabet pattern l