I need to make something in my code that will repeat the code until (i) is less or equal to 0, or until (n) is less or equal to zero.
repeatUntil(i <= 0, OR n <= 0);
something along those lines
Printable View
I need to make something in my code that will repeat the code until (i) is less or equal to 0, or until (n) is less or equal to zero.
repeatUntil(i <= 0, OR n <= 0);
something along those lines
Code:a:
if (i <= 0 || n <= 0) goto b;
/* Do stuff here */
goto a;
b:
/* Now outside of loop */
No, you should stay away from goto statements!
while, or do while loops are the proper way to repeat code until a specific condition. for loops if you know the number of iterations.
Please read the link in @stahta01's post #2