forked from avinash2201/Patterns
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpattern.c
More file actions
Latest commit
35 lines (34 loc) · 619 Bytes
/
Copy pathpattern.c
File metadata and controls
35 lines (34 loc) · 619 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
#Program to print half pyramid using *
#include<stdio.h>
intmain()
{
inti, j, rows;
printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1; i<=rows; ++i)
{
for(j=1; j<=i; ++j)
{
printf("* ");
}
printf("\n");
}
return0;
}
# Program to print half pyramid using alphabets
#include<stdio.h>
intmain()
{
inti, j, rows;
printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1; i<=rows; ++i)
{
for(j=1; j<=i; ++j)
{
printf("%d ",j);
}
printf("\n");
}
return0;
}