Write a program to print the pascal triangle of the given input size. Use System.out.println or System.out.print for printing.
Input (Integer) | Printed Output |
---|---|
2 | 1 |
5 | 1 |
10 | 1 |
class SimplePascalTriangle
{ public static void main(String s[])
{
int input = 10;
printPascalTriangle(input);
}
public static void printPascalTriangle(int input) {
//Write a code here to print Pascal triangle of the given size
}
}
Topic: Learn Arrays And Loops