C++ program that makes an equilateral triangle using stars??????

i tried my best bu ti could not find the right answer fo r that question..
i want to write a c++ programm that will print the following on the console:
*
***
*****
it should have the equilateral triangle pattren
please help me????????/

Trending Now

Answers

Best Answer: See my code below for a C++ solution to the problem. Only one 'for' loop is needed, if you take advantage of what iomanip can do for you. If you consider the spaces between the lines as contributing a unit of length, then it's an equilateral triangle. Otherwise, it's isosceles.

I tested this in vb.net and it gave me the exact printout you have above. I just took out the not equals and updated the second loop to have a different index variable.....the two i's wont work well. Update the code you tried and it will work.