Question: Write a program in C++ that gets three data values as input and outputs the average of those values. Make sure that your program has
Write a program in C++ that gets three data values as input and outputs the average of those values. Make sure that your program has a comment header and uses appropriate data types for the variables. The average must be calculated using a function. This is what the function prototype should look like: float average(int, int, int);
Sample output:
| Enter x: 5 Enter y: 10 Enter z: 8 Average is 7.66667 |
Write a program to compute the area of a triangle given the three sides of the triangle as a, b, and c. Compute s = (a+b+c) and area = s.(s-a).(s-b).(s-c). To compute square root, include the library math.h and use sqrt function. More at http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.7.html#sqrt
Sample output:
| Enter a: 5 Enter b: 5 Enter c: 5 s is 7.500000. Area is 10.825317. |
please answer both thank you..
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
