Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / sheetal

<?php
$k=1;
while($k<9)
{
for($i=1;$i<=3;$i++)
{
echo $k;
$k++;
}
echo "</br>";
}
?>

Is This Answer Correct ?    7 Yes 0 No

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

Answer / 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

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

Answer / sam

<?php
$num = "";
for($i = 1; $i<=9; $i++ )
{
if($i%3 == 1)
{
echo "<br />";
}
echo $i;
}
?>

Is This Answer Correct ?    2 Yes 1 No

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

Answer / ronak sharma

<?php
$count=0;
for($i=1;$i<=3;$i++)
{
for($j=1;$j<=3;$j++)
{
$count++;
echo $count;
}

echo "<br>";
}

?>

Is This Answer Correct ?    1 Yes 0 No

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

Answer / rajendra

<?php
$num = "";
for($i=1;$i<=9;$i++) {

$num .= $i;
if($i%3==0){
$num .="<br />";
}

}
echo $num;
?>

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More PHP Interview Questions

write function of the sentence traversal passing the parameter, e.g input:this is input sentence. output:sentence input is this.

1 Answers   HyperQuality,


What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?

1 Answers  


How many ways there are to fetch the data from the Database?

2 Answers   Tops Technologies,


What is an abstract class in php?

0 Answers  


What is php date function?

0 Answers  


What is the special meaning of __sleep and __wakeup?

0 Answers  


What is polymorphism?

0 Answers  


How do I find out the number of parameters passed into function?

1 Answers  


What changes to done in PHP.ini file for file uploading?

2 Answers  


How can you upload a file using php?

0 Answers  


What is the functionality of md5 function in php?

0 Answers  


What is local variable in php?

0 Answers  


Categories