Print Table Using Do While , While & For Loop.

 

OUTPUT

Do While

5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50

While Loop

5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50

For Loop

5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50

For Loop With Table

TableMultipleNumberEqualResult
15 x1 =15
15 x2 =30
15 x3 =45
15 x4 =60
15 x5 =75
15 x6 =90
15 x7 =105
15 x8 =120
15 x9 =135
15 x10 =150

DEMO

Table Print of a Number in PHP

(Visited 34 times, 1 visits today)

Written by:

Leave a Reply

Your email address will not be published. Required fields are marked *