write a program to print
[123]
[456]
[789]
note : braces also need to be printed
Answers were Sorted based on User's Feedback
Answer / digambar kangude
$k=1;
for($i=1; $i<=3; $i++)
{
echo "[";
for($j=1;$j<=3;$j++)
{
echo $k;
$k++;
}
echo "]";
}
| Is This Answer Correct ? | 14 Yes | 3 No |
Answer / sumit manchanda
<?php
$count=0;
echo "[";
for($i=1;$i<10;$i++){
if($i%3==0){
echo "$i";
echo "]";
echo "</br>";
$count++;
}else{
if($count==3){
echo "[";
$count=0;
}
$count=$count+1;
echo "$i";
}
}
?>
| Is This Answer Correct ? | 11 Yes | 1 No |
What is a php namespace?
What are the different data types in javascript?
Explain about the data types in PHP?
How to get the number of visitors in a site?
What is final in php?
What is the difference between Session and Cookie?
What is difference between get and post in php?
Tell me is it possible to submit a form with a dedicated button?
If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
How can we extract string 'abc.com' from a string "http://info@abc.com" using regular expression of PHP
What is $row in php?
how to send mail in php but mail should be send in inbox not in spam.....:(