Variables


  1. What is the scope of a function?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    From the point of declaration to the end of the file being compiled


  1. What is the scope of an external variable?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    From the point of declaration to the end of the file being compiled



  1. What will be the output of the following C code (after linking to source file having definition of arrayA)?
    #include <stdio.h>
    int main()
    {
    extern arrayA[];
    printf("%d\n", arrayA[0]);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Compile time error because datatype of array is not provided


  1. What will be the output of the following C code (without linking the source file in which arrayA is defined)?
    #include <stdio.h>
    int main()
    {
    extern arrayA[];
    printf("Interview Mania\n");
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Interview Mania



  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. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Scope rules followed