Problem

What will the following program display if the user enters 40 for testl and 3C for test2...

What will the following program display if the user enters 40 for testl and 3C for test2?

using namespace std;

int main()

{

cout << "Enter your first test score: ";

int testl;

cin >> test1;

cout << "Enter your second test score: ";

int test2;

cin >> test2;

int sum = testl + test2;

if (sum > 50)

testl += 10;

test2 += 10;

int sum = testl + test2;

}

cout << "test 1: " << testl << endl;

cout << "test 2: " << test2 << endl;

cout << "sum : " « sum << endl;

return 0;

}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT