#include<stdio.h>
int tmp=20;
main()
{
printf("%d", tmp); ----------------------------- Line:1
func();----------------------------------------- Line:2
printf("%d", tmp);------------------------------ Line:3
}
func().......................................... Line:4
{
static int tmp=10;------------------------------- Line:5
printf("%d", tmp);------------------------------ Line:6
}
Since tmp is a global variable. So, line: 1 will print 20.
then on calling the function "func() " in Line:2, control of program will go to Line 4 then under which new local variable "tmp=10" is defined statically, So, on executing line:6 gives output 10
On executing Line: 3, again global variable comes into the picture, Since C language follows static scoping so free variable refers to global variable. so it prints value:20
so final output will be : 20 10 20
option B will be correct...