Q.4
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
Ans:
C
Output
of the given program will be “Linker error-undefined symbol x”. External
variables
are declared outside a function.
No comments:
Post a Comment