Answer to Question #340559 in C++ for Kireina

Question #340559

Make a c++ program that will print the average of the values of the three quizzes using function. The values of the quizzes are input values from the user.


1
Expert's answer
2022-05-13T17:01:53-0400
#include <iostream>

using namespace std;

double average(double, double, double);

int main()
{
    double n1, n2, n3;
    
    cout << "Enter three integers:" << endl;
    cin >> n1 >> n2 >> n3;
    
    cout << "Average is " << average(n1, n2, n3) << endl;
}

double average(double a, double b, double c)
{
    double averageValue = (a + b + c) / 3;
    return averageValue;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS