Variables


  1. What will be the output of the following C code?
    #include <stdio.h>
    int *ptr;
    int main()
    {
    if (ptr == NULL)
    printf("Right\n");
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Right


  1. What will be the output of the following C code?
    #include <stdio.h>
    int *p;
    int main()
    {
    if (p == 0)
    printf("Hey\n");
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Hey only if NULL value is 0



  1. Which of the following statement is false?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    It is not an error if the variable is declared and not defined. For example – extern declarations.


  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



  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