+2 votes
by kratos

What is the output of the following program?

main ( )

{ extern int x;

x = 20;

printf(“\n%d”, x);

}

(A) 0

(B) 20

(C) error

(D) garbage value

1 Answer

+5 votes
by kratos
 
Best answer

Correct option -**(C) error**

Explanation:-

Output of the given program will be “Linker error-undefined symbol x”. External variables are declared outside a function.

...