phptutorials

PHP Script to print Floyd’s Triangle

Floyd’s Triangle is a right-angled triangle filled with rows of consecutive numbers. It starts with 1:

Example of 4 rows of Floyd’s Triangle:

1
2 3
4 5 6
7 8 9 10

Let’s see how to print Floyd’s Triangle using PHP and HTML:

It’s a pretty easy program just see the above script to understand how it works.

You can also see the demo of this program in the below link:

demo

 

Related Posts

Leave a Reply