Home » C++ Programming » Pointers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    void function(int p)
    {
    cout << p;
    }
    int main()
    {
    void (*num)(int);
    num = &function;
    (*num)( 3 );
    num( 11 );
    return 0;
    }
    1. 11
    2. 3
    3. 311
    4. 113
    5. None of these
Correct Option: C

As we are calling the function two times with the different value, So it is printing as 311.



Your comments will be displayed only after manual approval.