ProgrammingHardTCS NQT · Infosys · Product Company SDE

What is the output of this C program (assume a typical 64-bit platform: int 32 bits, long and pointers 64 bits)? #include <stdio.h> int main(void) { signed char c = 195; c += 81; printf("%d", c); return 0; }

  1. A. 20
  2. B. -236
  3. C. 76
  4. D. 276

Correct answer: A. 20

signed char holds −128..127; 195 (which wraps to -61) + 81 → 20 after wrap-around (modulo 256).

More C Programming questions

Exams that ask this topic