//Triangles class Triangles{ public static void main (String [] args){ System.out.print("This Program prints a triangle of stars "); System.out.println("using for loops."); System.out.println("By Garth Bruen, Oct. 4, 1998"); System.out.println(); char s; //puts the star in a variable s = '*'; for(int row = 1; row < 10; row++){ //Loop creates upper triangle for(int col = 0; col < row; col++) System.out.print(s); System.out.println(); } for(int row = 10; row > 0; row--){ //Loop creates lower triangle for(int col = 0; col < row; col++) System.out.print(s); System.out.println(); } System.out.println(); System.out.println("End program"); } }