Skip to content

Instantly share code, notes, and snippets.

@alonzoibarra97
Last active April 5, 2016 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alonzoibarra97/d50346b68823a1912d1b9f39daac765b to your computer and use it in GitHub Desktop.
Save alonzoibarra97/d50346b68823a1912d1b9f39daac765b to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float x[10], average, V=0, Sd, total=0;
for(int i=0; i<10;i++)
{
cout<<"Give me a number\n";
cin>>x[i]
}
for(int i=0; i<10;i++;)
{
total=total+x[i];
}
cout<<"the sum is: \n"<<total;
average =total/10;
cout<<"The average is: \n"<<average;
for (int i=0; i<10; i++)
{
V= V+ (pow(x[i]-average),2);
}
Sd= V/10;
cout<< "The standard deviation is: "<< sd;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment