Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int main()
    {
    int i = 97, *p = &i;
    foo(&i);
    printf("%d ", *p);
    }
    void foo(int *p)
    {
    int j = 2;
    p = &j;
    printf("%d ", *p);
    }
  2. A.
    2   97
    B.
    2   2
    C.
    Compile time error
    D.
    Segmentation fault/code crash

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    None.


Be The First To Comment