Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8 . What will be the final output of the following code snippet when a user enters input values in the order 1 0 ,

8. What will be the final output of the following code snippet when a user enters
input values in the order 10,20,30,40,50, and -1?
4. double sum =0;
5. int count =0;
6. double salary =0;
7. double average =0;
8. cout << "Enter salaries (-1 to stop): "<< endl;
11. cin >> salary;
14. sum = sum + salary;
15. count++;
16.}
17.}
20. average = sum / count;
21. cout << "The Average Salary: "<< average << endl;
22.}
23. else

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions