RASTER TRAINGLES!!! 1 Answer(s) 4 years and 8 months ago
Posted in : Java Beginners
View Answers
October 27, 2008 at 5:58 PM
Hi friend,
import java.io.*;
public class TrianglesDemo{ final static int WIDTH = 10; public static void main(String[] param) throws IOException{ InputStreamReader m = new InputStreamReader(System.in); BufferedReader n = new BufferedReader(m); System.out.print("Give me the size of each triangle : "); int size = Integer.parseInt(n.readLine()); System.out.print("The number of triangles you want to output in each row : "); int noOfTriangles = Integer.parseInt(n.readLine()); System.out.print("The number of rows of triangles you want to output : "); int noOfRows = Integer.parseInt(n.readLine()); raster(size, noOfTriangles, noOfRows); }
public static void raster(int a, int b, int c){ String result = "";