-
-
Save alonzoibarra97/d50346b68823a1912d1b9f39daac765b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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