1.

What is the output of this program?
#include <iostream>
using namespace std;
class N
{
public:
N(int k = 0){ _k = k;}
void fun()
{
cout << "Program Executed..."< }
private:
int _k;
};
int main()
{
N *ptr = 0;
ptr -> fun();
}

A. Program Executed...
B. Compilation Error
C. Runtime Error
D. Garbage value
E. None of these
Answer» B. Compilation Error


Discussion

No Comment Found

Related MCQs