ProgrammingModerate
The sum of the entries of row 4 of Pascal's triangle (row 0 at the top) is what?
- A. 8
- B. 15
- C. 32
- D. 16
Correct answer: D. 16
Row n of Pascal's triangle sums to 2^n (the number of subsets of n items), so row 4 = 1, 4, 6, 4, 1 sums to 16. 32 counts the top row as row 1 and uses 2^5.
More C Programming questions
- How many 1s are on the main diagonal of a 4 x 4 identity matrix?
- printf("%d", builtinpopcount(1023)); Is this a portable C expression? What does it mean for the count of 1 bits in 1023?
- The lowest bit that is zero in x = 0b1011 is isolated by ~x & (x + 1). What value does this give?
- With 16-bit unsigned arithmetic, (65535 x 2) & 0xFFFF is what?
- How many multiples of 4 lie between 1 and 100 inclusive?
- What is gcd(84, 36) by the Euclidean algorithm?