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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.