Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int *f();
    int main()
    {
    int *p = f();
    printf("%d\n", *p);
    }
    int *f()
    {
    int j = 10;
    return &j;
    }
  2. A.
    10
    B.
    Compile time error
    C.
    Segmentation fault/runtime crash
    D.
    Undefined behaviour

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    None.


Be The First To Comment