Program to find Arithmetic Mean using c++ programming language.


  #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

Popular posts from this blog

Multiple inheritance,friend function and multiple file in oop(object oriented programming)

Concepts of OOP (object oriented programming)

Concepts in c++........