Below are the various examples of pyramid patterns that are made using the combination of stars and the combination of numbers. This pyramid includes an inverted pyramid, full pyramid, left and right half pyramid, etc. And the program to print that pyramids
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,n;
printf("Enter the number of rows for half pyramid: ");
scanf("%d",&n);
for(i=1;i<=n;i++){
for(j=1;j<=i;j++){
printf("*");
}
printf("\n");
}
getch();
}
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,n;
printf("Enter the number of rows for half pyramid: ");
scanf("%d",&n);
for(i=n;i>=1;i--){
for(j=i;j>=1;j--){
printf("*");
}
printf("\n");
}
getch();
}
You are offline, Please check your internet connection.
You are back online.