hereisgoes Posted March 1, 2012 Share Posted March 1, 2012 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*. "<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! Quote Link to comment Share on other sites More sharing options...
hereisgoes Posted March 1, 2012 Author Share Posted March 1, 2012 The is supposed to be is: Quote Link to comment Share on other sites More sharing options...
litebearer Posted March 1, 2012 Share Posted March 1, 2012 Perhaps... <?PHP for($i=1;$i<9;$i++) { echo "8 x " . $i . " is " . $i*8 . "<br />"; } ?> Quote Link to comment Share on other sites More sharing options...
hereisgoes Posted March 1, 2012 Author Share Posted March 1, 2012 Awesome! Thank you so much, is there a way to mark this as solved. Quote Link to comment Share on other sites More sharing options...
kicken Posted March 1, 2012 Share Posted March 1, 2012 Awesome! Thank you so much, is there a way to mark this as solved. There is a 'Topic Solved' button at the bottom of the thread you can click to mark it as solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.