What is the output of the following C program? Assume a 16-bit…

PYQ UGC NET 2007Modified — slightly modified from the official paper; see the solution

What is the output of the following C program? Assume a 16-bit two's-complement int and an arithmetic right shift of negative values. main() { printf("%x", (unsigned int)(-1 >> 4)); }

  1. A.

    ffff

  2. B.

    0fff

  3. C.

    0000

  4. D.

    fff0

Attempted by 37 students.

Sign up free to check your answer

Sign up free

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…