0
Isosceles triangle
How do I draw the Isosceles triangle with *
2 Réponses
+ 15
● basic way to make isosceles triangle is by using 3 loops(1 outer and 2 inner), giving initial space in each iteration of outer loop(getting reduced 1 in each iteration) & printing (2n-1) number of stars in each iteration of outer loop(n from 1 to size), in short, printing a row in each iteration of outer loop
//1 inner loop for initial space in beginning of each row & another 1 for number of stars in each row
● example, here size is 4 , take _ as a space " "
_____*
____***
___*****
__*******
_*********
/*
note: number of loops can be reduced by simple noticing of pattern & by selecting different language too.
pattern made assuming the Isoscles traingle to be filled from inside, to make hollow isosceles triangle use similiar logic with little modification.
*/
0
would u give me this code plz?