Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int main()
    {
    char *p = NULL;
    char *q = 0;
    if (p)
    printf(" p ");
    else
    printf("nullp");
    if (q)
    printf("q\n");
    else
    printf(" nullq\n");
    }
  2. A.
    nullp  nullq
    B.
    Depends on the compiler
    C.
    x nullq where x can be p or nullp depending on the value of NULL
    D.
    p   q

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    None.


Be The First To Comment