-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy path09-Nested-Loops.c
More file actions
49 lines (36 loc) · 883 Bytes
/
09-Nested-Loops.c
File metadata and controls
49 lines (36 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Nested Loops
A nested loop means a loop statement inside another
loop statement. That is why nested loops are also
called “loop inside loops“. We can define as many loops
as we want inside of our loops.
Syntax:
for ( initialization; condition; increment ) {
for ( initialization; condition; increment ) {
// statement of inside loop
}
// statement of outer loop
}
Syntax:
while(condition) {
while(condition) {
// statement of inside loop
}
// statement of outer loop
}
Practice Problem
FizzBuzz
*/
/*
int n = 6;// variable declaration
//printf("Enter the value of n :");
// Displaying the n tables.
for(int i=1;i<=n;i++) // outer loop
{
for(int j=1;j<=10;j++) // inner loop
{
printf("%d\t",(i*j)); // printing the value.
}
printf("\n");
}
*/