php program print square number pattern
php program print square number pattern
Example :-
<?phpecho "<pre>";//define the number of rows$rows =5;//loop each rowfor($i=1;$i<=$rows;$i++){echo " ";//loop each columfor($j=1; $j<=$rows;$j++){ echo $j*$j." ";}echo "</br>";}echo "</pre>";?>
php program print square number pattern
<?php
echo "<pre>";
//define the number of rows
$rows =5;
//loop each row
for($i=1;$i<=$rows;$i++){
echo " ";
//loop each colum
for($j=1; $j<=$rows;$j++)
{
echo $j*$j." ";
}
echo "</br>";
}
echo "</pre>";
?>
Output :-
Related Post :-
Post a Comment