. Answer the questions that follow given these lines of code. string str1, str2;
ID: 1797202 • Letter: #
Question
. Answer the questions that follow given these lines of code.string str1, str2;
cin >> str1 >> str2;
if(str1 == str2)
{
cout << str1 << " == " << str2 << endl;
}
else if (str1 > str2)
{
cout << str1 << " > " << str2 << endl;
}
else
{
cout << str1 << " < " str2 << endl;
}
a. What do these lines output if the input is "diamond diamond"?
b. What do these lines output if the input is "diamond gold"?
c. What do these lines output if the input is "silver gold"?
Explanation / Answer
a) diamond == diamond b) diamond goldRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.