![](https://mohit-manna.github.io/assets/img/posts/c-pattern.png)
Print a Kite Pattern Using Two Loops
#include<stdio.h>
#include<conio.h>
//03 August 17 by Mohit
void main()
{
int i,j,k,l,t,s;
l=0;
t=l;
k=0;
clrscr();
freopen("pyra2lp.txt","w",stdout);
printf("\n Enter the length: ");
scanf("%d",&l);
for(j=l;j>=1;j--)
{
printf("\t");
for(i=j;i>1;i--)
{
printf(" ");
//print " " in decrement format
}
k=k+2;
for(s=1;s<k;s++)
{
printf("*");
//printing * in odd count
}printf("\n");
}
for(j=1;j<=l;j++)
{
printf("\t");
for(i=1;i<=j;i++)
{
printf(" ");
//printing " " in increment
}
k=k-2;
for(s=1;s<k;s++)
{
printf("*");
//printing * in decreasing odd
}
printf("\n");
}
fclose(stdout);
getch();
}
Output goes into a file
Output looks like
Enter the length: 5
*
***
*****
*******
*********
*******
*****
***
*