Write two procedure called mean_(int N) and var_(int N) that calculate and display the mean and variance of N real entered from the keyboard (without using an array).
double mean_(int n) {
double foo = 0;
for (int i = 0; i < n; i++ ){
double bar;
cin >> bar;
foo += bar;
}
return foo/n;
}
Comments
Leave a comment