![]() |
|
#1
|
|||
|
|||
please help me convert this code to while loopi have a code for multiplication table using for loops but i don't know how to convert it to while loops.please help me convert it to while loop statement.thank you.
CPP / C++ / C Code:
Last edited by LuciWiz : 15-Aug-2005 at 03:32.
Reason: edited title
|
|
#2
|
||||
|
||||
|
Quote:
In order to use this loop as a conditional while statement you need to,
So the loops you want to create will look something like, CPP / C++ / C Code:
For the sake of arguement, lets say that the size was 2. When you get to the while... line it asks, Is c less than or equal to size? If yes, enter the loop. If no, skip it by and get on with the program. When inside the loop, you do what you wanted to do, in your case print out some information. Than you increase your variable that you are checking against size. Lather, Rinse, Repeat... That should give you an idea of how the construct works. HTH Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
Recent GIDBlog
Developing GUIs with wxPython (Part 4) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Guidelines for posting requests for help - UPDATED! | WaltP | C++ Forum | 1 | 22-Aug-2008 00:07 |
| Array 1 dimensional help please asap | lion123 | C Programming Language | 10 | 18-Feb-2005 21:53 |
| Problem with int mixed with char,... | leitz | C++ Forum | 17 | 07-Dec-2004 20:56 |
| [Header]Classifying the FOR loop | mithunjacob | C++ Forum | 0 | 20-Jun-2004 16:39 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The