Okay friends this is actually my school work.
My teacher asked me to make a diamond asteriks.
I just try and with my code
#include<iostream>
using namespace std;
int main()
{
char b='*';
for(int i=10;i>0;i--)
{
for(int j=0;j<i;j++)
{
cout<<" ";
}
for(int c=10;c>i;c--)
{
cout<<b;
}
for(int a=10;a>i;a--)
{
cout<<b;
}
cout<<""<<endl;
}
for(int f=0;f<10;f++)
{
for(int d=0;d<f;d++)
{
cout<<" ";
}
for(int g=10;g>f;g--)
{
cout<<b;
}
for(int g=10;g>f;g--)
{
cout<<b;
}
cout<<""<<endl;
}
cin.ignore(cin.rdbuf()->in_avail()+1);
return 0;
}
I can displayed something like this
How can I displayed like this
with only one asteriks at the start.
Thanks.