ProgrammingModerateTCS NQT · Infosys

printf("%d", 0x7FFFFFFF == 2147483647); What is printed?

  1. A. 0
  2. B. 1
  3. C. 2147483647
  4. D. compile error

Correct answer: B. 1

0x7FFFFFFF is the hexadecimal form of 2147483647, so the two constants are equal and the comparison yields 1.

More C Programming questions

Exams that ask this topic