Inverted Pyramid Star Pattern
Here you will learn to print a Inverted Pyramid Star Pattern in C programming language.
Program Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include <stdio.h> int main() { int num,i,j; printf("Enter a Number to print Inverted Star Pyramid : "); scanf("%d",&num); for (int i = 0; i < num; i++) { // Printing left side spaces for (int j = 0; j < i; j++) { printf(" "); } // Printing stars for (int j = i; j < num; j++) { printf("* "); } printf("\n"); } return 0; } |
Output