PHP Alphabet Pattern 14

Last Updated:

PHP Alphabet Pattern 14

Try to print the following alphabet pattern using PHP.

Print This Output
A
ABC
ABCDE
ABCDEFG
ABCDEFGHI

Source Code

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

Share this Page

Meet the Author