Skip to content

Instantly share code, notes, and snippets.

@samir96
Created April 10, 2015 02:36
Show Gist options
  • Save samir96/7e181f8c3b51095a1ee2 to your computer and use it in GitHub Desktop.
Save samir96/7e181f8c3b51095a1ee2 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <math.h>
using namespace std;
int main (){
float arrayf[10],sum=0,average, sq=0, desv;
for (int i=0; i<10; i++)
{
cout<<"Give a number "<<(i+1)<<" : "<<endl;
cin>>arrayf[i];
}
for (int i=0; i<10; i++)
{
sum+=arrayf[i];
sq+=(arrayf[i])*(arrayf[i]);
}
average=sum/10;
desv=sqrt(sq/10);
cout<<"The suma of your your numbers: "<<sum<<endl;
cout<<"The average of tour numbers is: "<<average<<endl;
cout<<"The normal desviation is: "<<desv<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment