#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,a,b,c,d;
char hamza;
clrscr();
printf("enter height");
scanf("%d",&a);
printf("enter your desire symbol =");
hamza=getche();
clrscr();
b=a+a;
c=b/2;
d=c+1;
for(i=1;i<=a;i++)
{
for(j=1;j<=b;j++)
{
if((j==1)||(j==c)||(j==d)||(j==b)||(i==1)||(i==a))
{
printf("%c",hamza);
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}
No comments:
Post a Comment