Printf MCQ 2 : No Variable is Specified Printf(“%d”)



Printf MCQ 2 : No Variable is Specified in Printf


Predict the Output of the Following Program ?

  • All Programs are Compiled on Borland CC++ 3.0
#include<stdio.h>
void main()
{
printf("%d");
}

Options :

  1. Compile Error
  2. Run Time Error
  3. 0
  4. Garbage Value

[toggle title=”Output”]0[/toggle]


Switch to Printf MCQ Home : Click Here


How and Why ?

  1. Printf behavior is Undefined when No Variable is Specified
  2. Click Here to See All Observation of Undefined Behavior