In this post, we will write a program to generate a pascal triangle of given height.
For example, Pascal triangle of height 5 is shown below
1 2 1
1 3 3 1
1 4 6 4 1
The idea behind Pascal triangle is that each element in a row is the sum of left and right elements in the previous row. If the previous row does not contain left/right, they are considered as 0. The same idea is used to write simple program like the following.