OutPut:
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
Code:
<?php
// Your code here!
for($i=1;$i<=5;$i++){
echo $i;// $i as row
for($j=1;$j<5;$j++){ // $j as column
echo " ";
echo ($j+1)*$i;
}
echo "\n";
}
?>
5 * 5 matrix with column multiplied by row in php
Tagged with: matrix php, php, PHP Interview Questions & Answers
Posted in matrix php, php, php interview question
Posted in matrix php, php, php interview question
Leave a comment