hi can someone helped me in my triangle ><?
my prof told me to make a program that ask the user to input the height of the triangle and the user must be able to input the height..
and the triangle must be a triangle not a right triangle..
this are my codes but it's lacking one for loop idk what to put in that for loop T^T..please help me ><
code:
#include<iostream.h>
void main()
{
int a,b=1,c,d,r=1;
do {
cout<<"please input the height of the triangle"<<endl;
cin>>a;
for(a; a>0; a--) {
for(c=b; c>0; c--) {
cout<<a;
}
b=b+1;
cout<<endl;
}
cout<<"do you want to repeat the program? enter 1 if yes and 2 if not"<<endl;
cin>>r;
}
while(r==1);
}