I am solving problem 9 on the Project Euler. In my solution I use a "goto" statement to break out of two for loops. The Problem is the following:
I can't think of a better alternative. But one alternative not using goto would be modifying the first for-loop:
goto
for
for (a = 1; a
Then break out of the second for-loop. That will work assuming the result will never be -1 after the second for-loop has been broken by break.
break
-1