December 6, 2011
In 1653 Blaise Pascal published his treatise Traité du triangle arithmétique describing his triangle computing the binomial coefficients, which are used in the study of probability; Pascal gets credit for the name even though both the coefficients and their arrangement in a triangle were known before him.
To compute the triangle, start with a row containing only 1. Then each succeeding row is built by adding the two numbers triangularly above the current number, assuming a temporary 0 at each end of the prior row.
Your task is to write a program to neatly display Pascal’s Triangle. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.