ProgrammingHardTCS NQT · Wipro

What is printed?

What is printed?
#include <stdio.h>
int main(void) {
    printf("%d", 1000 >> 3);
}
  1. A. 125
  2. B. 124
  3. C. 126
  4. D. 250

Correct answer: A. 125

Shifting right by 3 divides a non-negative value by 8, giving 125 exactly.

More C Programming questions

Exams that ask this topic