![]() |
|
|
#1 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
PHP Code:
Code:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
Last edited by sharma.s.prakash; 08-08-2011 at 12:55 PM. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
One of the most common examples while studying programing. BUT very useful for building program Logic - both structural and looping... always like this.
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
yah these are the common example. when at the begining of any programming these are vary use full so that any can know how to manipulate loops whats the effect on out put if any changes are done some variation are applied.These are important at the beginning of programming.
can also try this to make diamond shape ![]() PHP Code:
Code:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Last edited by sharma.s.prakash; 08-08-2011 at 12:54 PM. |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
This is the Magic of Mathematics and Programming.I would love to see STAR like display also. Is that possible? |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
yah it is possible
replace echo $m.' '; with echo '* '; and see the output; you will get it |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
your mean this or something to display this shape in STAR Shape.
|
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
PHP Code:
Code:
*
* *
* * *
* * * *
* * * * *
* * * * * * * * * * * * *
* * * * * * * * * * *
* * * * * * * * *
* * * * * * * * * * *
* * * * * * * * * * * * *
* * * * *
* * * *
* * *
* *
*
Last edited by sharma.s.prakash; 08-09-2011 at 10:55 AM. |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Aug 2011
Posts: 131
|
Excellant code
very interesting |
|
|
|
|
|
#9 |
|
Member
Join Date: Sep 2011
Posts: 42
|
Twinkle, twinkle, little star How I wonder what you are Up above the SEPTANET so high Like a diamond in the sky.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|