#include<iostream>
using namespace std;
int Mean234(int a, int b);
int Mean234(int a, int b, int c);
int Mean234(int a, int b, int c, int d);
int main()
{
double a, b, c, d;
cout << "Enter two values :" << endl;
cin >> a >> b;
cout << Mean234(a, b) << endl;
cout << "Enter three values :" << endl;
cin >> a >> b >> c;
cout << Mean234(a, b, c) << endl;
cout << "Enter four values :" << endl;
cin >> a >> b >> c >> d;
cout << Mean234(a, b, c, d) << endl;
return 0;
}
int Mean234(int a, int b)
{
cout << "Arithmetic Mean is :";
return((a + b) / 2.0);
}
int Mean234(int a, int b, int c)
{
cout << "Arithmetic Mean is :";
return((a + b + c) / 3.0);
}
int Mean234(int a, int b, int c, int d)
{
cout << "Arithmetic Mean is :";
return((a + b + c + d) / 4.0);
}
Comments
Post a Comment