Question: 1 . What will the following program display on the screen? #include Using namespace std; class Package { private: int value; public: Package ( )

1. What will the following program display on the screen?
#include
Using namespace std;
class Package
{
private:
int value;
public:
Package()
{ value =7; cout << value << endl; }
Package(int v)
{ value = v; cout << value << endl; }
~Package()
{ cout << value << endl; }
};
int main()
{
Package obj1(4);
Package obj2;
Package obj3(2);
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!