ProgrammingHardTCS NQT · Infosys

long long x = 1000000LL * 1000000; What is x?

  1. A. 1000000000000
  2. B. 1000000
  3. C. 0
  4. D. -727379968

Correct answer: A. 1000000000000

The LL suffix makes the multiplication long long, so the exact value 10^12 is stored. Multiplying two plain ints would overflow, which is undefined.

More C Programming questions

Exams that ask this topic