Examveda

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void func(int x)
{
    cout << x ;
}
int main()
{
    void (*n)(int);
    n = &func;
    (*n)( 2 );
    n( 2 );
    return 0;
}

A. 2

B. 20

C. 21

D. 22

Answer: Option D


Join The Discussion

Related Questions on Functions and Procedures in C plus plus