how do i write a java code preferably using the 'while-do', 'if-else', 'for' statements to get these outcomes?
n is the input and the system prints triangles of height n?
n=2
. *
***
n=5
........*
......***
....*****
..*******
*********
ignore the dots, they are to align them properly
thanks in advance