Showing posts with label triangle patterns in trading. Show all posts
Showing posts with label triangle patterns in trading. Show all posts

Sunday, May 26, 2024

Character patterns in php program

 

Character patterns

Alphabet Triangle  Method


Character patterns


 1] range() with for loop  (Patterns)

 Example :-

<?php
$alpha=range('A','c');
for($i=0;$i<5;$i++)
{
    for($j=5;$j>$i;$j--)
    {
        echo $alpha[$i];
    }
    echo "<br>";
}
?>

 1] range() with for loop (Patterns)

Output

  
php patterns program

 2] range() with for loop  

(Patterns)


Example 

<?php
$alpha=range('A','Z');
for($i=0;$i<5;$i++)
{
    for($j=0;$j<=$i;$j++)
    {
        echo $alpha[$i];
    }
    echo"<br>";
}

Output
php patterns program

3] range() with for loop 

 (Patterns)

Example 

<?php
$alpha =range('A','z');
{
    for($i=0;$i<5;$i++)
    {
        for($j=0;$j<=$i;$j++)
    {

     echo $alpha[$j];
    }
    echo "<br>";
    }
}

3] range() with for loop
Output

4] range() with for loop

 (Patterns)


Example 
<?php
$alpha =range('A','Z');

 for($i=5; $i>=1; $i--)
 {
    for($j=0; $j<=$i;$j++)
    {
        echo '';
        }
       $j--;
       for($k=0;$k<=(5-$j);$k++)
       {
        echo $alpha[$k];
       }
       echo "<br>\n";
    }
?>


4] range() with for loop 

 (Patterns Program)

Output


READ MORE