Jump to content

ConditionalStatement while loop question


hereisgoes

Recommended Posts

Hi guys.  I am new here but have been following the board for about a month.  I will try to contribute as much as possible.  I was given a problem, and need some help out with it.  Most of you will probably find it pretty simple.

 

Here is what I have:

 

?>

//Rewrite the while loop using a for loop.

 

for

        echo "8 times $num is: " . ($num*8). "<br/>"

}

 

/* For the output I need:

8 times 1 is:8

8 times 2 is:16

8 times 3 is: 24

8 times 4 is:32

8 times 5 is:40

8 times 6 is: 48

8 times 7 is: 56

8 times 8 is:64

8 times 9 is: 72

8 times 10 is: 80

*/

?>

 

So basically I need to fill in that missing code(rewrite the while loop using a for loop)

 

Thank you so much in advance!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.