Theory
C program to print following Pyramid:
**********
**** ****
*** ***
** **
* *
#includeint main() { int n,i,j; int space=0; printf("Enter the number of rows:\n"); fflush(stdout); scanf("%d",&n); /*run loop (parent loop) till number of rows*/ for(i=n;i>0;i--) { /*print first set of stars*/ for(j=0;j< i;j++) { printf("*"); } for(j=0;j< space;j++) { printf(" "); } /*print second set of stars*/ for(j=0;j< i;j++) { printf("*"); } printf("\n"); space+=2; } return 0; }
From Pattern Printing in C · C programming
C program to print following Pyramid:
C program to print following Pyramid:
C Program to print half pyramid a using numbers
Program to print full pyramid using *
C Program to Print Floyd's Triangle.
Write a program in C to generate following pattern using unformatted input/output functions only.
Inverted full pyramid using *
C program to print following Pyramid: