-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforpatternstar.c
36 lines (34 loc) · 1.14 KB
/
forpatternstar.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
//WAP tp print Nepal flag like pattern
#include<stdio.h>
int main()
{
int i,j,r;
printf("Enter no. of rows u want to print: ");
scanf("%d",&r);
for(i=1;i <= r;i++)
{
for(j=1;j <= i;j++)
{
printf(" * "); /*printf(" %d ",j); printf(" * "); printf(" %d ",i);
1 * 1
1 2 ** 2 2
1 2 3 *** 3 3 3
1 2 3 4 **** 4 4 4 4 */
}
printf("\n");
}
for(i=1;i <= r;i++)
{
for(j=1;j <= i; j++)
{
printf(" * ");
}
printf("\n");
}
for(i=1;i<=r+1;i++)
{
printf(" *");
printf("\n");
}
return 0;
}