There was an error while loading. Please reload this page.
1 parent 63fb71a commit 4438b80Copy full SHA for 4438b80
inverted_star_triangle.c
@@ -0,0 +1,24 @@
1
+/*
2
+Problem Statement: Write a C program to print an inverted triangle of
3
+asterisks (*) that starts with n stars and decreases by one each row.
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 = 1; i <= n; i++)
17
+ {
18
+ for ( j = n; j >= i; j--)
19
+ printf(" * ");
20
21
+ printf("\n");
22
+ }
23
+ return 0;
24
+}
0 commit comments