c programming 1 Write a function named ave2 that returns the

(c++ programming)

1.) Write a function named ave2 that returns the exact average of three integer parameters named num1 & num2 that are passed to it. Do not write a whole program. Do not write a call statement. Do not write a function declaration statement. Only write the function header and its body.


Solution

#include<iostream>
using namespace std;

double ave2(int num1,int num2)
{
return (num1+num2)/2.0;
}

int main()
{
int num1 = 1,num2 = 9;
cout << \"Average is : \" << ave2(num1,num2);
return 0;
}

OUTPUT:

Average is : 5

(c++ programming) 1.) Write a function named ave2 that returns the exact average of three integer parameters named num1 & num2 that are passed to it. Do not

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site