heres my code. i need a triangle that looks like:
****
_ ***
__**
___*
but mine looks like:
****
***
**
*
can anyone help ?
void drawTriangle(){ //function to hold triangle code
char c; //variable to hold character to make triangle
int height; //variable to hold height of triangle
cin >> height;
cin >> c;
cout<< "Triangle" <<endl;
for (int i=1;i<=height;i++){
for (int j=height;j>=1;j--){
if (i<j){
cout << c;
}
else{cout << " ";}
}
cout << endl;
}
}