Write a PHP code to print following number pattern:
123
456
789

Answer Posted / akashumate

<? php

$i=1;

while($i<=3)
{
echo $i;
$i++;
}
echo "<br>" ;
$j=$i;
while($j<=6)
{
echo $j;
$j++;
}
echo "<br>" ;

$k=$j;
while ($k<=9)
{
echo $k;
$k++;
}
echo "<br>" ;

? >

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable and data type?

759


Does php support overloading?

793


Explain what is the difference between session and cookie?

779


How do you trim spaces in excel?

776


What is the use of count() function in php?

737


What websites use php?

738


Is php pass by reference or value?

768


Why do we use polymorphism in php?

770


What is the integer?

819


What are the final class and final method?

796


Which method removes the last element from the end of an array?

729


What are the differences between session and cookie?

784


How to read the entire file into a single string?

801


What is polymorphism?

2286


Which function is used to read a file removing the html and php tags in it upwork?

719