Home » C Programming » Functions » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    int *fun()
    {
    int *ptr1 = 10;
    return ptr1;
    }
    void main()
    {
    int *ptr2 = fun();
    printf("%d", ptr2);
    }
    1. Garbage value
    2. Compilation Error
    3. Nothing
    4. 10
    5. None of these
Correct Option: D

10



Your comments will be displayed only after manual approval.