-
Which of the following is the correct output for the program given below?
#include <stdio.h>
int main ()
{
int a = 400, b, c;
if ( a >= 500)
b = 400;
c = 300;
printf ( "%d %d %d \n" , a, b, c);
return 0;
}
-
- 400 400 300
- Garbage 400 300
- 400 Garbage 300
- 400 400 Garbage`
Correct Option: C
if( a >= 500) is equivalent to if(false).
So the initialization of b will never be done.
Output
400 Garbage 300