122. Data Conversion and Encoding-ii

Question.1

A developer swaps the byte order of a 32-bit value for big-endian transmission:

uint32_t swap32(uint32_t val) {
   return ((val >> 24) & 0xFF)       |
           ((val >> 8)  & 0xFF00)     |
           ((val << 8)  & 0xFF0000)   |
           ((val << 24) & 0xFF000000);
}

printf("0x%08X", swap32(0x12345678));

What is the output?

Need Help? Refer to the Quick Guide below

Select Answer