Pattern #11

Example#1: C program to generate pattern 11

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

Output:

Facebook Comments

Back to Top