the code for drawing diamond is:
int i,j,k,x;
clrscr();
cout<<"Enter Odd Number(1-19):";
cin>>x;
for(i=1;i<=x/2+1;i++)
{
cout<
for(j=0;j<=x/2-i;j++)
cout<<" ";
for(k=0;k<=2*(i-1);k++)
cout<<"*";
}
for(i=x/2;i>0;i--)
{
cout<
for(j=0;j<=x/2-i;j++)
cout<<" ";
for(k=0;k<=2*(i-1);k++)
cout<<"*";
} how can I change it inorder to have hallow diamond like this:
*
* *
* *
* *
*
2006-09-12
22:06:48
·
1 answers
·
asked by
simona
1
in
Computers & Internet
➔ Programming & Design
*
* *
* *
* *
*
2006-09-12
22:08:13 ·
update #1
I can't draw the diamond here
2006-09-12
22:09:21 ·
update #2