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 can I rotate an image?
1 Answers Rushmore Consultancy,
how can we check mail function with '127.0.0.1' (before submitting a site?
Explain mysql_errno()?
How do I clear my browser session?
How data or variable can be receive or send from PHP to HTML page??
Why triggers are used in mysql?
What is $_ env in php?
programm for factorial
Tell me what is the difference between exception::getmessage and exception::getline?
Why do we use csrf token?
Which php framework is in demand?
Declare a new variable in php equal to the number 3;