Answer to Question #212590 in C++ for Kefilwe Mamabolo

Question #212590

Use a function called double detAverege() to determine the average percentage. The function will receive 3 integer parameters. The 3rd mark will be passed by reference.


1
Expert's answer
2021-07-02T04:10:21-0400
/******************************************************************************
Use a function called double detAverege() to determine the average percentage. 
The function will receive 3 integer parameters. The 3rd mark will be passed by reference.


*******************************************************************************/


#include <iostream>


using namespace std;


double detAverege(int a, int b, int &c){
    int sum=a+b+c;
    double avg=sum/3.0;
    return avg;
}
int main()
{
    int x=67;
    int y=34;
    int z=78;
    cout<<"Average percentage: "<<detAverege(x,y,z);


    return 0;
}

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