help for loop

Can anyone show me how to make this shape
*
***
*****
*******
* *
***********


i can make the triangle but i want to have the spaces on top of the base
Last edited on
And what code do you have so far?
#include <iostream>

using namespace std;

int main()
{
int q=1;

for (int w=1;w<=10;w++)
{
for (int c=10;c>w;c--)
{
cout<<" ";
}





for (int d=1;d<=q;d++)
{
cout<<"*";
if (w==6)
{
for (int g=0;g<d;g++)
{
cout<<" ";
}
}


}
cout<<endl;
q=q+2;





if (w==5)
{
for (int p=0;p<11;p++)
{
cout<<" ";
}
}


}

}
Topic archived. No new replies allowed.