Multiple choice

What will be the output of the following set of codes after execution? void main() { printf(“%d %d %d ”,56,056,0x56); }

  1. 56 56 56

  2. 56 056 56

  3. 56 46 86

  4. 56 56 86

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

%d specifier display the output in decimal number system. 56 is the decimal number, 056 is the octal number equivalent to 46 in decimal, 0x56 is the hexadecimal number equivalent to 86 in decimal. So, the output will be 56 46 86.