#include < stdio.h>
#include < conio.h>
main()
{
int m,i,j,r,k,ch;
char x;
do
{
clrscr();
printf("\n ***STARS***\n\n\n PATTERNS\n -----------\n 1.RIGHT TRIANGLE-up\n 2.RIGHT TRIANGLE-down\n 3.TRIANGLE-common\n 4.EQUILATERAL TRIANGLE-up\n 5.EQUILATERAL TRIANGLE-down\n 6.DIAMOND\n\n ");
printf("ENTER NO. OF ROWS:");
scanf("%d",&r);
printf("\n ENTER THE PATTERN:");
scanf("%d",&ch);
clrscr();
printf("\n\n");
//1
if(ch==1)
{
for(i=1;i<=r;i++)
{
for(j=0;j{
printf(" *");
}
printf("\n");
}}
//2
if(ch==2)
{
for(i=r;i>=0;i--)
{
for(j=0;j{
printf(" *");
}
printf("\n");
}}
//3
if(ch==3)
{
for(i=1;i<=r;i++)
{
for(j=0;j{
printf(" *");
}
printf("\n");
}
for(i=r-1;i>=0;i--)
{
for(j=0;j{
printf(" *");
}
printf("\n");
}}
//4
if(ch==4)
{
for(i=1;i<=r;i++)
{
m=r-i;
for(k=0;k
for(j=0;j{
printf(" *");
}
printf("\n");
}}
//5
if(ch==5)
{
for(i=r;i>=0;i--)
{
m=r-i;
for(k=0;k
for(j=0;j{
printf(" *");
}
printf("\n");
}}
//6
if(ch==6)
{
for(i=1;i<=r;i++)
{
m=r-i;
for(k=0;k
for(j=0;j{
printf(" *");
}
printf("\n");
}
for(i=r-1;i>=0;i--)
{
m=(r)-i;
for(k=0;k
for(j=0;j{
printf(" *");
}
printf("\n");
}}
//
if(ch>6)
{
printf("invalid code\n");
}
printf(" DO YOU WANT TO CONTINUE(y/n)..");
scanf("%s",&x);
}
while(x=='y');
clrscr();
printf("\n\n\n\n\n\n\n\n ***THANK YOU***\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n programer:jitkaramel(e-mail:jithinkaramel@gmail.com)");
getch();
}