Open In App
Related Articles

C | Pointer Basics | Question 7

Improve Article
Improve
Save Article
Save
Like Article
Like





What is the output of above program?
(A) Machine dependent
(B) 513
(C) 258
(D) Compiler Error


Answer: (A)

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[0] = 1 and x[1] = 2, the number a is changed to 00000001 00000010 which is representation of 513 in a little endian machine.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 04 Feb, 2013
Like Article
Save Article
Previous
Next
Similar Reads