Hi All,
Program to Display following using php code:
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
CODE:
Start php here
$k=1;
for($i=0;$i<5;$i++){
for($j=0;$j<=$i;$j++){
echo $k." ";
$k++;
}
echo "
";
}
End php tag
Check out the output...
All d best
Friday, June 25, 2010
Subscribe to:
Post Comments (Atom)
can u plz give me code for
ReplyDelete0
01
010
0101
01010
';
Delete}
?>
for($i=1; $i<=5; $i++){
Deletefor($j=1; $j<=$i; $j++){
if($j%2==0){
echo 0;
}
else
{
echo 1;
}
}
echo "
";
}
This comment has been removed by the author.
Delete
Deletefor($i=1; $i<=5; $i++)
{
for($j=1; $j<=$i; $j++)
{
if($j%2==0)
{
echo 0;
}
else
{
echo 1;
}
}
echo "";
}
This comment has been removed by the author.
ReplyDelete";
ReplyDelete}
?>
Output :
0
0 1
0 1 0
0 1 0 1
0 1 0 1 0
Coding
ReplyDelete$k=1;
for($i=0;$i<5;$i++){
for($j=0;$j<=$i;$j++){
if($j%2==0)
{
$k=0;
}
else
{
$k=1;
}
echo $k." ";
}
echo "
";
}
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteCode ** Star pattern
Delete=1;$j--){
echo "* ";
}
echo "
";
}
?>
can you give a php code to make hexagonal....?
ReplyDeletecan u plz give me code for
ReplyDelete1
121
12321
1234321
123454321
1;$k--)
Delete{
echo $k-1;
}
echo '
';
}
?>
plz give this piramit code
ReplyDelete1
12
122
1223
12233
122333
plz give this piramit code
ReplyDelete1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
';
Delete}
?>
This comment has been removed by the author.
ReplyDeleteTHAT'S NICE
ReplyDelete';
ReplyDelete}
?>
';
ReplyDelete}
?>
" ;
ReplyDelete}
?>
tag missing ... because
tag in your code is displayed as line brake in browser.. so please update your post...
please help me:
ReplyDelete*
##
***
####
*****