|
C Programming Reference >> C Programming Reference Question Bank >> 19/07/07 - 458 Views - Ratings : Question - Guess the output of the following code.
Answer - i = 3 j = 2 Explanation - First thing of importance is that value of j may vary depending upon size of the integer on the machine, 2 assume here so value of j is 2. Most important thing to not is 'sizeof' is operator who returns a unsigned integer of type size_t which represents size in bytes require to store the expression in the memmory. The thing is that only end result of expression type is counted and the expression being operated on is not evaluated so (++i + ++i) is never actually executed so value of i remains unchange as a result value of i is displayed as its intialization value 3. Reader Comments -
|
|||