Creating a heart
#include<iostream>
using namespace std;
int main ()
{ int i,j,k,l,m,n,o;
for(i=1;i<=3;i++)
{cout<<endl;
for(k=8;k>=2*i +2;k--)
{
cout<<" ";
}
for(j=1;j<=2*i+2;j++)
{
cout<<"* ";
}
for(l=8;l>=2*i+2;l--)
{
cout<<" ";
}
for(j=1;j<=2*i+2;j++)
{
cout<<"* ";
}
}
for (i=1;i<=9;i++)
{cout<<endl;
for(k=1;k<=2*i-1;k++)
{
cout<<" ";
}
for(j=18;j>2*i-1;j--)
{
cout<<"* ";
}
}
return 0;
}
.png)
Comments
Post a Comment