Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. What will be the output of the following program?

    #include<stdio.h>

    void main()

    {

    int i = 10;

    void *p = &i;

    printf("%d\n", (int)*p);

    }

  2. A.

     Compiler time error

    B.

     Segmentation fault/runtime crash

    C.

     10

    D.

     Undefined behavior

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    p is pointer of type void.


Be The First To Comment