ProgrammingModerateTCS NQT · Accenture

What is printed?

What is printed?
#include <stdio.h>
int main(void) {
    unsigned long long p = 0xFFFFu * 0xFFFFu;
    printf("%llu", p);
}
  1. A. 4294967295
  2. B. 65535
  3. C. 4294836225
  4. D. 4294836226

Correct answer: C. 4294836225

0xFFFF is 65535, and 65535^2 = 4294836225, which is below 2^32 so no wrap happens.

More C Programming questions

Exams that ask this topic