Multiple choice technology programming languages

What will be the output of the following program : void main() { int a=5,b=6; printf("%d"); }

  1. Compile time error

  2. 5

  3. 6

  4. Unpredictable

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

Since printf has a format specifier but no arguments supplied, it reads from the stack or registers in an undefined manner, yielding unpredictable output rather than a compile error.