Your task is to define a union that allows viewing a 16-bit unsigned value both as a full word and as two separate bytes on a little-endian system.
The union must contain:
uint16_t word
uint8_t bytes[2]
Assume the target system uses little-endian byte order, where:
bytes[0]
bytes[1]
The program will:
Example:
Input
4660
Output
LSB=52 MSB=18
Explanation
4660 = 0x1234
0x34
52
0x12
18
Constraints
0
65535
uint16_t
Test Cases
Test Results
Expected Output