Equilateral star triangle in C | C Program to Create Equilateral Triangle of stars | Equilateral Triangle of star in C Programming | C Program to print Equilateral Triangle of Asterisk

Equilateral star triangle in C | C Program to Create Equilateral Triangle of stars | Equilateral Triangle of star in C Programming | C Program to print Equilateral Triangle of Asterisk





#include
main()
{
    int j,i,k,l;
    char c;
    do
    {
        printf("Enter the number of stars in the base..");
        scanf("%d",&k);
        for (i=1;i<=k;i++)
        {
            for(l=0;l<(k-i);l++)
                printf(" ");
            for (j=0;j<i;j++)
                printf ("* ");
            printf("\n");
        }
        printf("\n Enter y to try more...press any other key exit...\t");
    c=getchar();
    c=getchar();
    }
    while(c=='y');
}

No comments:

Post a Comment