![]() |
| ||
| How can I add a loop for this code The code is pretty easy to understand what I am doing. You basically pick a number 1-4 and it will do either addition, subtraction, multiplication, or division. What I need it to do is after they do a problem it loops back and lets them do it again, until they enter 5 to end the program. Thanks. Here is my code #include <iostream> |
| ||
| Re: How can I add a loop for this code Simply.. //... |
| ||
| Re: How can I add a loop for this code [code] while (choice!=5) { Your Programme Body }[\code] Remember to Intialize Choice With any Number without 5 |
| ||
| Re: How can I add a loop for this code Quote:
Thanks. |
| ||
| Re: How can I add a loop for this code while (choice!=5) Remember to Intialize Choice With any Number without 5 |
| ||
| Re: How can I add a loop for this code Quote:
|
| ||
| Re: How can I add a loop for this code
|
| ||
| Re: How can I add a loop for this code I was doing a similair problem, and with some help from people on here found that using a do-while loop with a switch instead of four if statements worked best. Check out the last page for some pointers... http://www.daniweb.com/forums/thread159343.html |
| ||
| Re: How can I add a loop for this code Quote:
|
| ||
| Re: How can I add a loop for this code Ok I just can not get the loop to work. I tried what was in the second post but it does not work. Please help. I am stuck on the code I already posted. Thanks. |
| All times are GMT -4. The time now is 11:30 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC