Write an if-else statement that prints "Goodbye" if userString is "Quit", else prints "Hello". End with newline.
#include <iostream>
#include <string>
using namespace std;
int main() {
string userString;
cin >> userString;
/* Your solution goes here */
return 0;
}
1
Expert's answer
2019-12-02T12:16:56-0500
#include <iostream>
#include <string>
using namespace std;
int main() {
string userString;
cin >> userString;
/* Your solution goes here */
if (userString=="Quit") cout << "GoodBye!" << endl;
Comments
Leave a comment