Multiple choice technology programming languages

2) void main() { unsigned char a; a = 0XFF + 1; printf(“%d”,a); }

  1. 255

  2. 256

  3. 0

  4. 1

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

An unsigned char can only hold values from 0 to 255 (8 bits, 2^8 - 1). When you assign 256 (0xFF + 1), it wraps around to 0 due to unsigned integer overflow. This is standard behavior in C for unsigned types - they implement modular arithmetic.