#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,a,x;
printf("enter the number of diamond=");
scanf("%d",& a);
for(x=1;x<=a;x++)
{ for(i=4;i>=1;i--)
{
for(k=1;k<=5-i;k++)
printf(" ");
for(j=1;j<=2*i-1;j++)
{
printf("*");
}
printf("\n");
}}
getch();
}
#include<conio.h>
int main()
{
int i,j,k,a,x;
printf("enter the number of diamond=");
scanf("%d",& a);
for(x=1;x<=a;x++)
{ for(i=4;i>=1;i--)
{
for(k=1;k<=5-i;k++)
printf(" ");
for(j=1;j<=2*i-1;j++)
{
printf("*");
}
printf("\n");
}}
getch();
}
No comments:
Post a Comment
Please comment bellow. Share your knowledge