//Downloaded From theonlinetutorials.com
#include<stdio.h>
#include<conio.h>
void main()
{
int n=6,k,i,j;
clrscr();
printf("How many star you want ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\n");
for(j=1;j<=i;j++)
printf(" *");
}
getch();
for(i=1;i<=n;i++)
{
printf("\n");
for(k=n;k>=i;k--)
printf(" ");
for(j=1;j<=i;j++)
printf(" *");
}
getch();
for(i=1;i<=n;i++)
{
printf("\n");
for(k=n;k>=i;k--)
printf(" ");
for(j=1;j<=i;j++)
printf("*");
}
printf("\n");
getch();
for(i=1;i<=n;i++)
{
printf("\n");
for(k=1;k<=i;k++)
printf(" ");
for(j=n;j>=i;j--)
printf(" *");
}
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C Program – Display a line graph using midpoint line algorithm.
- C Program – Implement the midpoint circle drawing algorithm
- C program to display the inventory of items in a store/shop The inventory maintains details such as name, price, quantity and manufacturing date of each item.
- C program to accept an array of 10 elements and swap 3rd element with 4th element using pointers. And display the results
- C Program – Draw a rectangle and perform the operations.
