Start PHP Code RESULT

4000 divided by 1 is... 4000

4000 divided by 2 is... 2000

4000 divided by 3 is... 1333.3333333333

4000 divided by 4 is... 1000

4000 divided by 5 is... 800

4000 divided by 6 is... 666.66666666667

4000 divided by 7 is... 571.42857142857

4000 divided by 8 is... 500

4000 divided by 9 is... 444.44444444444

4000 divided by 10 is... 400

End PHP Code RESULT

for ($counter=1; $counter <= 10; $counter++) { $temp = 4000/$counter; print "4000 divided by $counter is... $temp<br />"; }The PHP Code END

Note: setting counter variable to 0 (zero) generates a division by 0 error. That's why counter is set to "1"

Here's the error message you would get: