Why would you want to wrap this
if around the
while:
if (k > 1 && m < n)
{
while(k > 1 && m < n)
{
}
} As you can see both conditions are the same, so you can leave out this
if
Edit::
Like this:
This is possible because the instructions in the while loop's body will only get executed when the condition is
true (in this case the condition is:
k > 1 && m < n, so if this condition isn't true at the beginning of the while loop, your program will just skip over all the instructions inside the loop's body, and proceed executing the first statement after the while loop (if there's one))
Last edited by tux4life; Jul 14th, 2009 at 11:01 am. Reason: fix broken code tag
Reputation Points: 2125
Solved Threads: 243
Postaholic
Offline 2,105 posts
since Feb 2009