This preview shows page 1. Sign up to view the full content.
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 Pascals triangle. (Note: The numbers in the triangle have many useful mathematical properties. For example, row n of Pascals 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
This note was uploaded on 11/10/2010 for the course PROGRAMMIN 2860U taught by Professor Saman during the Fall '10 term at UOIT.
 Fall '10
 SAMAN

Click to edit the document details