1.

What is the output of this program?
#include 
using namespace std;
class Example
{
private:
int num;
public:
void input()
{
cout << num;
}
void Result()
{
cout << "Entered Variable is: ";
cout << num << " n";
}
};
int main()
{
Example obj;
obj.input();
obj.Result();
obj.num();
return 0;
}

A. Runtime Error
B. Garbage value
C. Compilation Error
D. Entered Variable is: 15
E. None of these
Answer» D. Entered Variable is: 15


Discussion

No Comment Found

Related MCQs