How to use While loop to modify the "for loop" source code
Thanks for the help
Last edited on
1 2 3 4 5 6 7 8 9 10 11 12
|
int main()
{
int x is 0
int r is 0
while( r is less than x )
{
increment r
}
return 0
}
|
Hope that helps.
If all you need to do is convert your
for
loops into
while
loops, then just keep in mind that
1 2 3 4
|
for (initialization; condition; action)
{
// ...
}
|
is basically the same as
1 2 3 4 5 6
|
initialization;
while (condition)
{
// ...
action;
}
|
Topic archived. No new replies allowed.