Home » C Programming » Variables » Question
  1. Which of the following is the correct output for the program given below?
    #include <studio.h>
    int main()
    {
    extern int x;
    x = 30;
    printf("%d\n", sizeof(x));
    return 0;
    }
    1. 2
    2. 4
    3. Would vary from compiler to compiler
    4. Error, x undefined
Correct Option: D

extern int x is a declaration and not a definition, hence the error.



Your comments will be displayed only after manual approval.