In this tutorial, we are going to write a C Program to print star patterns in a triangle shape in C Programming with practical program code and step-by-step full complete explanation.
C Program to print start pattern in a triangle shape
#include<stdio.h> #include<conio.h> void main() { int i, j; clrscr(); for(i =1; i<=5; i++) { for(j=1; j<=i; j++) printf("*"); printf("n"); } getch(); }
Output
* ** *** **** *****