1.

What is the output of this program?
#include <iostream>
using namespace std;
struct N
{
int k;
char ch;
float p;
void function();
};
void N :: function() {}
struct M
{
public:
int k;
char ch;
float p;
void function();
};
void M :: function() {}
int main()
{
N obj1; M obj2;
obj1.k = obj2.k = 2;
obj1.ch = obj2.ch = 'U';
obj1.p = obj2.p = 5.125;
obj1.function();
obj2.function();
cout << "Value Allocated in memory...";
return 0;
}

A. Compilation Error
B. Runtime Error
C. Value Allocated in memory...
D. 2 U 5.125
E. None of these
Answer» D. 2 U 5.125


Discussion

No Comment Found

Related MCQs