Diamond
________________________________________________________
#include<iostream.h>
main()
{
int a,b,c,d,e,f,x=1,y=7;
for (a=1;a<=5;a++)
{
for (b=4;b>=a;b--)
{
cout<<" ";
}
for (c=1;c<=x;c++)
{
cout<<"*";
}
x=x+2;
cout<<endl;
}
for (d=1;d<=4;d++)
{
for (e=1;e<=d;e++)
{
cout<<" ";
}
for (f=1;f<=y;f++)
{
cout<<"*";
}
y=y-2;
cout<<endl;
}
}
_________________________________________________________
Semoga Bermanfaat :)
makasih sudah share
ReplyDeletesolder hp