ProgrammingHardCompetitive coding (CP)

What is printed?

What is printed?
#include <stdio.h>
int main(void) {
    printf("%u", 0x80000000u * 3u);
}
  1. A. 6442450944
  2. B. 0
  3. C. 2147483648
  4. D. 1073741824

Correct answer: C. 2147483648

0x80000000 * 3 = 0x180000000, and reducing modulo 2^32 leaves 0x80000000 = 2147483648.

More C Programming questions

Exams that ask this topic