Hi, I am a beginner at coding and I recently received a question from my teacher, to make triangles using c++, in nested while loops.
The triangles were:
*
**
***
****
*****
******
*******
********
*********
********** \\ I have made a code for this:
int counter=1;
while (counter<=10){
int counter2=1;
while (counter2<counter){
cout<<"*";
counter2=counter2+1;
}
cout<<"*"<<"\n";
counter=counter+1;
}
**********
--*********
----********
------*******
--------******
----------*****
------------****
--------------***
----------------**
------------------*
I was not quite sure about this one.
Thanks for taking your time in helping me with this question.