create a class with name Control:
Output: (Click on the image to enlarge)
class Control {
public static void main(String args[]) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 10; j++) {
System.out.print(j + "\t");
if (j > 5) {
break;
}
}
System.out.println("Outer Loop :"+(i+1));
}
System.out.println("End");
}
}
public static void main(String args[]) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 10; j++) {
System.out.print(j + "\t");
if (j > 5) {
break;
}
}
System.out.println("Outer Loop :"+(i+1));
}
System.out.println("End");
}
}
Output: (Click on the image to enlarge)