dontcare_hi

Untitled

Jan 23rd, 2022
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a, b, c, d, e, A, W;
  9. cout << "Enter Numbers a, b, c, d and e : " << endl;
  10. cin >> a >> b >> c >> d >> e;
  11. cout << "Entered number a is: " << a << endl;
  12. cout << "Entered number b is: " << b << endl;
  13. cout << "Entered number c is: " << c << endl;
  14. cout << "Entered number d is: " << d << endl;
  15. cout << "Entered number e is: " << e << endl;
  16.  
  17. int myNum[5] = {a, b, c, d, e};
  18.  
  19. int min = INT_MAX, max = INT_MIN;
  20. for (int i: myNum)
  21.  
  22. cout << "Highest value in Array is: " << max << endl;
  23. cout << "Lowest value in Array is: " << min << endl;
  24.  
  25. A = (a+b+c+d+e)/5;
  26. cout << "Arithmetic Mean A is: " << A << endl;
  27. W = ((pow((a-A),2))+(pow((b-A),2))+(pow((c-A),2))+(pow((d-A),2))+(pow((e-A),2)))/5;
  28. cout << "variance of the array Mean W is: " << W << endl;
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment