Skip to content

Commit 95c1217

Browse files
committed
Create row_number_with_hash_pattern.c
1 parent 8987fe9 commit 95c1217

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

row_number_with_hash_pattern.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Problem Statement: Write a C program to print a pattern where each row
3+
prints the row number multiple times followed by a hash (#) symbol.
4+
*/
5+
6+
#include<stdio.h>
7+
8+
int main() {
9+
int i, j, n;
10+
11+
i = n;
12+
13+
printf("Enter the value for n: ");
14+
scanf("%d", &n);
15+
16+
for ( i = 0; i <= n; i++)
17+
{
18+
for ( j = 1; j <= i; j++)
19+
printf(" %d ", i);
20+
printf(" # \n");
21+
}
22+
return 0;
23+
}

0 commit comments

Comments
 (0)