There was an error while loading. Please reload this page.
1 parent 154901a commit 260209dCopy full SHA for 260209d
star_hash_pattern.c
@@ -0,0 +1,25 @@
1
+/*
2
+Create a C program that prints a triangle of asterisks followed
3
+by a hash # on each line, increasing by row.
4
+*/
5
+
6
+#include <stdio.h>
7
8
+int main()
9
+{
10
+ int i, j, n;
11
12
+ printf("Enter the value for N: ");
13
+ scanf("%d", &n);
14
15
+ i = n;
16
17
+ for (i = 0; i <= n; i++)
18
+ {
19
+ for (j = 1; j <= i; j++)
20
+ printf(" * ");
21
22
+ printf(" # \n");
23
+ }
24
+ return 0;
25
+}
0 commit comments