Created
May 1, 2015 19:51
-
-
Save fernandoalv/137438a72d3ee8eb5e7e to your computer and use it in GitHub Desktop.
WSQ10
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() | |
{ | |
double array[10]; | |
double a; | |
for(int i=0;i<10;i++) | |
{ | |
cout<<"dame el numero,que va ir en la posición "<< i+1<<endl; | |
cin>>a; | |
array[i]=a; | |
} | |
for(int i=0;i<10;i++){ | |
cout<<"El numero ingresado en la posición"<< i+1<< " fue :"<< array[i]<<endl; | |
} | |
double sum; | |
for(int i=0;i<10;i++){ | |
sum=sum+array[i]; | |
} | |
cout<<"la suma de los numeros es: "<< sum <<endl; | |
double average; | |
for(int i=0;i<10;i++) | |
average=sum/10; | |
cout<<"el promedio de los numeros es; "<<average<<endl; | |
double sd; | |
for(int i=0;i<10;i++){ | |
sd=sd+pow((array[i]-average),2); | |
} | |
sd=sd/9; | |
sd=sqrt(sd); | |
cout<<"la desviación estandar de los numeros es: "<<sd<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment