Star Pattern Series 1 - Triangle pyramid pattern in C programming language using stars
In This Program, We will see the Right Angle Triangle pyramid pattern or half triangle pattern in C programming language using stars.
*
**
***
****
*****
The C program for the above right angle triangle pyramid pattern or half triangle pattern is as follows:
#include<stdio.h>
int main() {
int i, j, noRows;
printf("Enter number of rows for pattern = ");
scanf("%d",&noRows);
for(i=0; i< noRows; i++) {
for(j=0;j<=i;j++) {
printf("*");
}
printf("\n");
}
return 0;
}
Output
Enter number of rows for pattern = 5
*
**
***
****
*****