|
C Programming Reference >> C Programming Reference Question Bank >> 19/07/07 - 593 Views - Ratings : Question - Predict the output of the following code and why? #include <stdio.h> 103846 Explanation - I can bet many of you thought the answer would be 124656 but it turned out to be 103846 and also that your observation is quite weak. Closely observe the value intialization, it starts with a zero which means values are octal and not decimal so 12 octal becomes 10 decimal, 46 becomes 38 and 56 becomes 46. So we get output 103846 instead of 124656. Carefully watch the code before answering every time. If you did congratualate yourself. Reader Comments -
|
||||