Multiple choice technology programming languages

What will be the output of the following program : void main() { unsigned int val=5; printf("%u %u",val,val-11); }

  1. Compile-Time error

  2. 5 -6

  3. 5 65530

  4. none of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

val=5 is unsigned int (typically 16-bit range 0-65535). val-11 = 5-11 = -6, which wraps around to 65530 (65535-6+1). The %u format prints unsigned values, so output is 5 65530. Option A is wrong - no compile error. Option B shows signed behavior which %u won't display.