Social Sciences, asked by Anonymous, 11 months ago

#include <stdio.h>

void main()

{

    extern int i;

    i = 20;

    printf("%d", sizeof(i));

}

What would be the output of the above code?


pranjal4101D: Paragraph on flood affected areas

Between 120 - 150 word

Answers

Answered by GhaintMunda45
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 kirangusain84
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