Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <algorithm>
- using namespace std;
- int main()
- {
- int a, b, c, d, e, A, W;
- cout << "Enter Numbers a, b, c, d and e : " << endl;
- cin >> a >> b >> c >> d >> e;
- cout << "Entered number a is: " << a << endl;
- cout << "Entered number b is: " << b << endl;
- cout << "Entered number c is: " << c << endl;
- cout << "Entered number d is: " << d << endl;
- cout << "Entered number e is: " << e << endl;
- int myNum[5] = {a, b, c, d, e};
- int min = INT_MAX, max = INT_MIN;
- for (int i: myNum)
- cout << "Highest value in Array is: " << max << endl;
- cout << "Lowest value in Array is: " << min << endl;
- A = (a+b+c+d+e)/5;
- cout << "Arithmetic Mean A is: " << A << endl;
- W = ((pow((a-A),2))+(pow((b-A),2))+(pow((c-A),2))+(pow((d-A),2))+(pow((e-A),2)))/5;
- cout << "variance of the array Mean W is: " << W << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment