Using the break Statement
Using the break Statement
<%
double array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int sum = 0;
for(int i = 0; i <
array.length; i++) {
sum += array[i];
if (sum > 12) break;
out.println("Looping...
");
}
out.println("The sum exceeded the maximum allowed value.");
%>