Home » C Programming » Variables » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int n;
    int main()
    {
    extern int n;
    if (p == 0)
    printf("Scope rules follow here\n");
    }
    1. Scope rules followed
    2. Nothing will be printed as value of n is not zero because i is an automatic variable
    3. Compile time error due to multiple declaration
    4. Compile time error due to not defining type in statement extern n
    5. None of these
Correct Option: A

Scope rules followed



Your comments will be displayed only after manual approval.