Question: Given the following code snippet, which input value ( s ) would cause the line Your favorite social media is Twitter. to be contained in

Given the following code snippet, which input value(s) would cause the line "Your favorite social media is Twitter." to be contained in the output?
int favorite =0;
cout "Select your favorite social media: ";
cin >> favorite;
switch (favorite){
case 1:
cout "Your favorite social media is Facebook.";
break;
case 2 :
cout "Your favorite social media is Twitter.";
break;
case 3 :
cout "Your favorite social media is Pinterest.";
break;
default:
cout "Your selection is not known.";
}
1
2
3
1 and 2
None of these; the code contains errors
Given the following code snippet, which input

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!