Question: What is output? #include using namespace std; class Greet { public: string g 1 ; string g 2 ; string g 3 ; string g

What is output?
#include
using namespace std;
class Greet {
public:
string g1;
string g2;
string g3;
string g4;
void Print() const;
Greet(){
g1="Hi!";
g3= "Good morning! ";
g4= "Good night! ";
}
};
void Greet::Print() const {
cout << g1<< g2<< g3;
}
int main(){
Greet user1;
user1.Print();
user1.g2= "Hello!";
}
Group of answer choices
Hi! Hello! Good morning! Good night!
Hi! Good morning! Good night!
Hi! Good morning!
Hi! Hello! Good morning!

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!