3
#pragma once
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
using namespace std;
int main()
{
//declare an array
float numbers [10];
double sum;
double mean;
double standardDeviation;
double AA;
double sdresult;
double mode;
double max;
double modeposition;
//storing 30 numbers entered by user in an array
cout<<"enter thirty floating point numbers"<<endl;
//compute sum, mean and standard deviation
for (int i = 0; i < 10; ++i)
{
cin >> numbers;
sum += numbers;
mean = sum /10;
AA += pow(numbers - mean,2);
max= numbers;
modeposition = i;
}
sdresult = sqrt(AA/10);
cout<<"sum="<<sum <<endl;
cout<<"mean="<<mean <<endl;
cout<<"standard Deviation = " <<sdresult<<endl;
cout<<"mode="<<modeposition<<endl;
return 0;
}