Write a C program to convert Little to Big endian integer

Write a C program to convert Little to Big endian integer

What is Endianess ?

Little and Big Endian are the ways of storing multi-byte data likes int, float, double etc.

Little Endian

In little endian machines, last byte of binary representation of the multi-byte data is stored first.

Big Endian

In big endian machines, first byte of binary representation of the multibyte data is stored first.

 

Write a C program to convert Little endian to Big endian integer

 

Code to convert Little endian integer to Big endianĀ 

 

Output

Write a C program to convert Little endian to Big endian integer