When s<k why we are itterating outer loop again

when we see that s<k than we break inner loop but outer loop runs what is the way to exit both loop.

to come out of all loops there are multiple ways

  1. make a flag and keeping track of that you can use multiple breaks to come out of all loops
    but in this method you have to use break multiple times

  2. goto label
    The ** goto** statement is also known as jump statement. It is used to transfer control to the other part of the program. It unconditionally jumps to the specified label. It can be used to transfer control from deeply nested loop or switch case label.

if your doubt is resolved .Please mark it as resolved

if you have any doubt regarding this feel free to ask