for (int i = 6; i>0; i--){
cout<<space;
for (int j = i-1; j >=0; j--){
cout << star << " ";
}
space += " ";
cout << endl;
}
this works if you're trying to create a triangle that tapers downwards