Inverted full pyramid in C programming language using star
In this program, we will see the Inverted full pyramid pattern in C programming language.
* * * * * * * * * * * * * * * * * * * * * * * * *
The C program for above Inverted full pyramid is as follows:
#include<stdio.h> int main() { int no_rows, spaces, i, j; printf("Enter number of rows = "); scanf("%d",&no_rows); for(i = no_rows; i >= 1; --i) { for(spaces = 0; spaces < no_rows-i; ++spaces) printf(" "); for(j=i; j <= 2*i-1; ++j) printf("* "); for(j=0; j < i-1; ++j) printf("* "); printf("n"); } getch(); return 0; }