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, i;
- 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 array[5] = {a, b, c, d, e};
- {
- int smallest = array[0] ; {
- for ( int i=1; i < sizeof(array)/sizeof(array[0]); ++i )
- if ( array[i] < smallest )
- smallest = array[i] ;
- cout << smallest << '\n' << endl;
- if ( array[i] > biggest )
- smallest = array[i] ;
- cout <<biggest << '\n' << 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 W is: " << W << endl;
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment