standard deviation?

hi all, im new here;
i need help about how to make a standard deviation in C++ using codes ?
thanks
using basic things because im a beginner ..
please tell me the formula and the requirements for the formula of standared deviation
Remember that in programming, you must declare things before you use them.

For example, given y = mx + b , to get y you must first have m, x, and b.

1
2
3
4
5
6
7
8
9
10
double m = 0.5;
double b = 4;
double x;

cout << "What is x? "; 
cin >> x;

double y = m*x + b;

cout << "Point is (" << x << "," << y << ")\n";
What is x? 0
Point is (0,4)

What is x? 4
Point is (4,6)

What is x? -12
Point is (-12,-2)

You will do the same sort of thing, except instead of a line you are calculating your standard deviation. You need your list of input samples (use an array), a function to compute the mean (or average) of the array, and a temporary array (for the variances).

Hope this helps get you started.
Topic archived. No new replies allowed.