Variables


  1. What will be the output of the following C code?
     #include <stdio.h>
    static int var = 15;
    void main()
    {
    var = 19;
    {
    int var = 14;
    }
    printf("%d", var);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    19


  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. 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. Property of the external variable to be accessed by any source file is called by the C90 standard as __________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    external linkage



  1. Can variable p be accessed by functions in another source file?
    #include <stdio.h>
    int p;
    int main()
    {
    printf("%d\n", p);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Yes