#include <iostream>
      #include <cmath>
      
      using namespace std;
      float calculateSD(float data[]);
      float calculateSD(float data[]) {
        float sum = 0.0, mean, standardDeviation = 0.0;
        int i;
        for(i = 0; i < 10; ++i) {
          sum += data[i];
        }
        mean = sum / 10;
        for(i = 0; i < 10; ++i) {
          standardDeviation += pow(data[i] - mean, 2);
        }
        return sqrt(standardDeviation / 10);
      }
      
      Cpp language logo

      Calculate Standard Deviation

      0

      0

      avatar
      Giovanny Gongora
      Codiga's C++ Recipes

      Calculates the standard deviation of an individual series using arrays.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.