Friday, August 23, 2019

Star Pattern

Star Pattern:


star pattern in cprograms.



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


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

void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<5*2;j++)
{
if(j<=i || j>=5*2-i)
{
printf("*");
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}


EmoticonEmoticon