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 program to print
[123]
[456]
[789]
note : braces also need to be printed

Answer Posted / soujj

$countr = 0;
for($i=1;$i<=9;$i++)
{
$countr++;
$str[] = $i;
if($countr % 3 == 0)
{
echo "[";
for($j=0;$j<=2;$j++)
{
echo $str[$j];
}
echo "]";
$str=array();
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between mysql_fetch_array() and mysql_fetch_assoc()?

849


How to retrieve the original query string?

1019


What is the difference between explode and split?

979


Do you know what's the difference between __sleep and __wakeup?

951


What u mean by query?

963


how to track no of users logged in?

971


Tell me what is the meaning of a final class and a final method?

1045


Tell me how the result set of mysql be handled in php?

931


What is difference between static and constant in php?

943


What are getters and setters and why are they important?

983


What is get method in java?

1000


Where is php code written?

939


What is the use of mysqli_real_escape_string() function?

867


Do I need apache for php?

1021


What is php routing?

926