My assignment in my Java course is to make 3 triangles. One left aligned, one right aligned, and one centered. I have to make a menu for what type of triangle and then input
Question:
* *** *****
Answer:
int i,a,j; i=5; while (i>=3) { a=1; while (a<=i) { System.out.print(" "); a++; } j=10; while (j/2>=i) { System.out.print("*"); --j; } System.out.println(""); i--; }
Enjoy!!