Output is 513 in a little endian machine. To understand this output, let integers be stored using 16bits. In a little endian machine, when we do x[0] = 1 and x[1] = 2, then umber a is changed to 00000001 00000010 which is representation of 513 in a little endian machine.