Open In App
Related Articles

C | Variable Declaration and Scope | Question 3

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
#include <stdio.h>
extern int var;
int main()
{
    var = 10;
    printf("%d ", var);
    return 0;
}

                    
(A) Compiler Error: var is not defined (B) 20 (C) 0

Answer: (A)

Explanation: var is only declared and not defined (no memory allocated for it) Refer: Understanding “extern” keyword in C

Quiz of this Question

Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads