Page 246 - CA_Blue( J )_Class9
P. 246
You will get the following output:
In the above program, when the value of ‘i’ is 3, the condition is true and the continue statement is executed. The
control then goes to the next iteration of the outer loop. For this reason, the statement “System.out.println()” is
not executed, and in the third line, 1 2 is printed.
Program 7 Using continue statement in the Inner Loop.
1 class innerloop_continue
2 {
3 public static void main()
4 { int i ,j;
5 for(i=5;i>=1;i--)
6 { for(j=1;j<=i;j++)
7 { if(j==3)
8 continue;
9 System.out.print(j); }
10 System.out.println();
11 }
12 }
13 }
You will get the following output:
244 Touchpad Computer Applications-IX

