C Program to print Right angled Triangle in a pyramid star pattern Type 1

Program

#include<stdio.h>
void main()
{
	int i, j, n;
	printf("Enter number of rows of stars to print\n");
	scanf("%d", &n);
	for(i = 0; i < n; i++)
	{
		for(j = 0; j <= i; j++)
		{
			printf("*");
		}
		printf("\n");
	}
}

Output

Enter number of rows of stars to print
5
*
**
***
****
*****