Star Pattern Program in C

In this section you will learn how to print star in c in easy way. We will print the star with help of for loop condition and then we will show the output on screen. In this program we are taking the input from user.

Star Pattern Program

How program will work?

Program of print star pattern in c


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

	//STAR PATTERN PROGRAM
	void main()
	{
		int value, i, k;
		clrscr();
	
		printf("ENTER NUMBER TO PRINT THE STAR:- ");
		scanf("%d",&value);

		for(i=1; i<=value;i++)
		{
			for(k=1; k<=i; k++)
			{
			 	printf("*");
			}
			printf("\n");
		}
		
	getch();
	}

Output:


	ENTER NUMBER TO PRINT THE STAR:- 5
	
	*
	**
	***
	****
	*****

Post Your Comment