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 does the php error 'parse error in php - unexpected t_variable at line x' means?
What is needed to be able to use image function?
What is php oops concepts?
How will you create a bi-lingual site (multiple languages) ?
What is php regular expression?
How to check whether a number is prime or not?
What are the different types of Errors in PHP?
20 Answers Cisco, TCS, Troop Software,
Explain about the connective abilities of the PHP?
What language is php written in?
What are php magic methods/functions?
How do I make a reset button in html?
How to delete a file from the system?