#include <iostream>
#include <math.h>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int i1, i2, i3, i4, i5, mean;
cout << "Enter the numbers: ";
cin >> i1 >> i2 >> i3 >> i4 >> i5;
mean = (i1 + i2 + i3 + i4 + i5)/5;
cout << "Mean = " << mean << endl;
cout << "Standard deviation = ";
cout << sqrt((pow(i1 - mean, 2) + pow(i2 - mean, 2) + \
pow(i3 - mean, 2) + pow(i4 - mean, 2) + pow(i5 - mean, 2))/5);
cout << endl;
return 0;
}
Comments
Leave a comment