Page 247 - CA_Blue( J )_Class9
P. 247
In the above program, whenever the value of ‘j’ is 3, the condition is true and the continue statement is executed.
The control goes to the next iteration of the inner loop without executing the statement “System.out.print(j);”.
This results in skipping an iteration of the loop.
21 st
Some More Programs Century #Coding & Computational Thinking
Skills
Program 1 Write a program to print the following pattern (Using for loop):
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 class for_pattern1
2 {
3 public static void main()
4 {
5 int i,j;
6 for(i=1;i<=5;i++)
7 { for(j=1;j<=5;j++)
8 { System.out.print(j+ " "); }
9 System.out.println();
10 }
11 }
12 }
You will get the following output:
Nested Loop 245

