There was an error while loading. Please reload this page.
1 parent 8987fe9 commit 95c1217Copy full SHA for 95c1217
row_number_with_hash_pattern.c
@@ -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