What is the output of above program?
(A) Machine dependent
(D) Compiler Error
Explanation: Output is 513 in a little endian machine. To understand this output, let integers be stored using 16 bits. In a little endian machine, when we do x = 1 and x = 2, the number a is changed to 00000001 00000010 which is representation of 513 in a little endian machine.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.