ProgrammingModerate
How many 1s are on the main diagonal of a 4 x 4 identity matrix?
- A. 4
- B. 3
- C. 8
- D. 16
Correct answer: A. 4
Each diagonal cell of an identity matrix is 1, and there are four of them.
More C Programming questions
- 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?
- How many divisors does 10 have among 1 through 10?