I have setup an array and i have calculated the sum of my array. Now i need to find standard deviation of the numbers entered in my array. here is my code
#include <iostream> using namespace std; int main() { int i=0, count, maxSize = 36; double arr[36]; double number; cout << "Enter number "; cin >> number; while ((i < maxSize) && (number != -99)) { arr[i] = number; i++; cout << "Enter another number "; cin >> number; } count = i; cout << "Numbers entered are " << endl; for (int j = 0; j < count; j++) cout << arr[j] << " " ; cout << endl; double sum = 0; for ( int i = 0; i < 36; i++ ) sum += arr[i]; cout<<"Average of data is "<< sum / 36 <<endl; system("pause"); return 0; }