Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    void A(int (*n)(int));
    int B(int);
    int (*P)() = B;
    int main()
    {
    A(P);
    }
    void A(int(*j)(int ))
    {
    j(121);
    }
    int B(int j)
    {
    printf("%d\n", j);
    return j;
    }
    1. Compilation Error
    2. Segmentation fault
    3. Garbage value
    4. 121
    5. None of these
Correct Option: D

121



Your comments will be displayed only after manual approval.