0% found this document useful (0 votes)
49 views1 page

PHP Tizag Tutorial-46

The document shows a price chart table with quantities from 10 to 100 in increments of 10 and corresponding prices from 50 to 500 in increments of 50. It notes that both a for loop and while loop could generate this table, but the for loop would be preferable here as it is more compact. The document indicates that later lessons will cover when to use a while loop over a for loop.

Uploaded by

Anil Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views1 page

PHP Tizag Tutorial-46

The document shows a price chart table with quantities from 10 to 100 in increments of 10 and corresponding prices from 50 to 500 in increments of 50. It notes that both a for loop and while loop could generate this table, but the for loop would be preferable here as it is more compact. The document indicates that later lessons will cover when to use a while loop over a for loop.

Uploaded by

Anil Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Display:

Quantity Price
10 50
20 100
30 150
40 200
50 250
60 300
70 350
80 400
90 450
100 500
It is important to note that both the for loop and while loop implementation of the price chart table are both
OK at getting the job done. However, the for loop is somewhat more compact and would be preferable in this
situation. In later lessons we will see where the while loop should be used instead of the for loop.

You might also like