How to print Paskal's Triangle in Java

67 Views Asked by At

Can I print this with triangle shape in Java?

I tried to print this with only border "1"s:

int[][] matrix = new int[5][5];


for (int i = 0; i < 5; i++) {

    matrix[i][i] = 1;
    matrix[i][0] = 1;

}
0

There are 0 best solutions below