ProgrammingHardCompetitive coding (CP)

What is printed?

What is printed?
#include <stdio.h>
#include <string.h>
int main(void) {
    size_t n = 0;
    printf("%d", n - 1 > 100);
}
  1. A. 0
  2. B. 1
  3. C. 2
  4. D. 3

Correct answer: B. 1

n - 1 wraps to SIZE_MAX, which is far greater than 100, so the comparison is 1.

More C Programming questions

Exams that ask this topic