ProgrammingVery hardGATE CS · Campus placements
For 4-bit masks (bits 0 to 3), how many masks have both bit 0 and bit 2 set?
- A. 2
- B. 6
- C. 4
- D. 8
Correct answer: C. 4
Bits 0 and 2 are fixed to 1, and bits 1 and 3 are free, giving 2 * 2 = 4 masks.
More C Programming questions
- What is the value of (1ULL << 63) >> 62 for uint64t arithmetic?
- uint8t a = 200, b = 250; uint8t avg = (a + b) / 2; What is avg?
- What is the value of 1 + 2 3 << 1 in C?
- How many positive divisors does 40 have?
- int next(void) { static int c = 0; return ++c; } Each of three calls returns its value, and the three returns are added together. What is…
- char s[] = "a0b"; What is strlen(s)?