Print stars in c

C Program to  Print stars


#include<conio.h>
#include<stdio.h>
void main()
{
        int i,j,l;
        clrscr();
        for(j=1;j<5;j++)
        {

            for(i=4;i>=j;i--)
            printf(" ");
            for(l=1;l<=2*j-1;l++)
            printf("*");
            printf("\n");
        }
        for(i=1;i<=6;i++)
        {
            for(j=0;j<=i;j++)
            printf(" ");
            for(l=5;l>=2*i-1;l--)
            printf("*");
            printf("\n");
        }
    getch();
}


Output:


Comments

Popular posts from this blog

SKILL ROCKS TECH QUESTIONS

C Program for Analog Clock Design

Php Check is date or not