Unformatted text preview: Incorrect (hint: 0 digits match) Your guess? 78 Incorrect (hint: 1 digits match) Your guess? 70 Incorrect (hint: 2 digits match) Your guess? 7 You got it right in 5 tries. Problem 2 Write a program that produces the first 11 rows of Pascal’s triangle. (Note: The numbers in the triangle have many useful mathematical properties. For example, row n of Pascal’s triangle contains the coefficients obtained when you expand the equation (x+y) n . Your program output may be the following: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1 1 10 45 120 210 252 210 120 45 10 1...
View
Full Document
 Fall '10
 SAMAN
 Harshad number, 2 digits, 1 digits, Tetrahedral number, Pentatope number, 0 digits

Click to edit the document details