Printf MCQ 4 : Two Variables are Declared but Not Specified



Printf Multiple Choice Questions  : Two Variables are Declared but Not Specified 


Predict the Output of the Following Program if Given Things are – 

  • Two Variables are declared .
  • Two Variables are initialized
#include<stdio.h>
void main()
{
int input1 = 10,input2 = 20;
printf("%d %d");
}

Options :

  1. 10 20
  2. 20 10
  3. 10 10
  4. 20 20

[toggle title=”Output”]20 10[/toggle]


Switch to Printf MCQ Home :  Click Here


How and Why ?

  1. Undefined Behavior of Printf
  2. Click Here to See All Observation of Undefined Behavior