#include <stdio.h>
void main()
{
extern int i;
i = 20;
printf("%d", sizeof(i));
}
What would be the output of the above code?
Answers
Answered by
3
Output : 20
extern int i; tell the compiler that int i is declared in some other file, in this code we have not included any other header file so it will cause compilation error.
Answered by
0
Answer:
Explanation: extern int a; indicates that the variable a is defined elsewhere, usually in a separate source code module. printf("%d\n", a); it prints the value of local variable int a = 20. Because, whenever there is a conflict between local variable and global variable, local variable gets the highest priority
Similar questions
Between 120 - 150 word