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 |
How to redirect https to http url and vice versa in .htaccess?
what is array_search() in php?
What does the initials of php stand for?
Why php script is not running in browser?
What is The difference between ' and " where they can ben in between or outmost and how
What does the unlink() function means?
Where are php configuration settings stored?
Can we override magic methods in php?
Are static variables final?
What is the purpose of basename() function in PHP?
What is the meaning of curl , which is used while connecting with pay pal? and how it works?
What is the use of header in php?