2016-09-26T04:17:52-04:00
Write a program that takes as input five numbers and find the mean (average) and standard deviation of the numbers.
1
2016-09-30T14:32:03-0400
#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; }
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS !
Learn more about our help with Assignments:
C++
Comments