Header Ad

C Program to print star pattern in a reverse triangle shape

In this tutorial, we are going to write a C Program to print star pattern in a reverse triangle shape in C Programming with practical program code and step-by-step full complete explanation.

C Program to print star pattern in a reverse triangle shape


C Program to print star patterns in a reverse triangle shape.

#include<stdio.h>
#include<conio.h>

void main()
{
	int i,j,k,m;

	clrscr();

	for(i=5;i>=1;i--)
	{
		for(j=1;j<=i-1;j++)
		printf(" ");

			for(k=1;k<=m;k++)
			printf("*");
	printf("\n");
    m++;
    }

	getch();
}


Output

    *
   **
  ***
 ****
*****

Post a Comment

0 Comments