Question: I'm having trouble trying to finish my code for this lab. I've tried multiple ways to figure it out but I get a syntax error

I'm having trouble trying to finish my code for this lab. I've tried multiple ways to figure it out but I get a syntax error instead. This is the code that I have so far and it works:

html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> </strong> Even and Odd Numbers <strong> "content-type" content="text/html; charset=utf-8" />

echo "

The Even Numbers between 1-100:

"; $inc = 2; while ($inc <= 100) {echo "$inc
"; $inc = $inc + 2;} echo " "; echo "

The Odd Numbers between 1-100:

"; for ($count = 1; $count <= 100;) {echo "$count
"; $count = $count + 2;} ?>

The line in the instructions that I cannot figure out is:

Give a line break every 10 numbers displayed on the screen.

My teacher told me to try using a count variable with either a

or , but I can't figure it out. I thought maybe something like $count += 10 / $inc += 10, but the program doesn't seem to like that no matter where I put them... Right now, the numbers are displaying with 1 number on each line... So, how can I solve my line break dilemma?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!