“Print star triangle center pattern” is C program to print the given output of stars pattern as shown below:
/* Write a C program to print star pattern triangle as shown below * *** ***** ******* ********* */ #include<stdio.h> int main() { int row, col, space=5, s; for( row = 1; row <= 9;row+=2 ) { for(s=1; s<=space;s++) printf(" "); for(col=1; col<=row; col++) printf("*"); printf("\n"); space--; } return 0; }
Here is an image to show sample run and output of the C program to print the stars pattern as shown.