-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoto_statement_ex_2.c
45 lines (40 loc) · 991 Bytes
/
goto_statement_ex_2.c
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
#include <stdio.h>
int main() {
int value = 18;
int i = 1, j, k= 0;
outerLoop:
if (i < value) {
j = i;
innerLoop:
if (j < value) {
printf(" ");
j++;
goto innerLoop;
}
else {
innerLoop2:
if (k != ((2 * i))) {
if (k == 0 || k == (2 * i) - 3) {
printf("*");
}
printf(" ");
k++;
goto innerLoop2;
}
k = 0;
printf("\n");
i++;
goto outerLoop;
}
}
else {
i = 0;
loop:
if (i < (2 * value) - 1) {
printf("*");
i++;
goto loop;
}
}
return 0;
}