-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpattern.c
More file actions
64 lines (61 loc) · 1.19 KB
/
Copy pathpattern.c
File metadata and controls
64 lines (61 loc) · 1.19 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//18-21 All patterns problems
#include<stdio.h>
void main()
{
for (int i = 1; i <= 4; i++)
{
for (int j = 1; j <= i; j++)
{
printf("1");
}
printf("\n");
}
for (int i = 1; i <=4; i++)
{
for (int j = 1; j <=i; j++)
{
printf("%d",i);
}
printf("\n");
}
for (int i = 1; i <=4; i++)
{ int a=i;
for (int j = 1; j <= i; j++)
{
printf("%d",a);
a++;
}
printf("\n");
}
for (int i = 1; i <= 4; i++)
{
for (int j = 1; j <= i; j++)
{
printf("*");
}
printf("\n");
}
for (int i = 0; i < 4; i++)
{
for (int j = 4; j > i; j--)
{
printf("*");
}
printf("\n");
}
}
// ***** patterns
// #include <stdio.h>
// int main() {
// int i, j, space;
// for(i = 1; i <= 5; i++) {
// for(space = 1; space <= 5 - i; space++) {
// printf(" ");
// }
// for(j = 1; j <= 2* i -1; j++) {
// printf("*");
// }
// printf("\n");
// }
// return 0;
// }