answersLogoWhite

0

1. Calculate the mean average of the N numbers. Suppose it is stored in the variable D.

2. Now calculate the differences between each number with D and square the value. As there are N numbers so store this difference in an array. Example arr[0] = (num0 - D)^2; arr[1] = (num1 - D)^2; arr[N-1] = (numN - D)^2;

3. Now sum array value and divide by N, suppose the value is stored in F. Now square root F. It is the standard deviation of your N number.

I hope you can write the code by yourself or follow the part:

suppose you will store the N numbers in an array num. Now:

int num[N+2], D = 0; //or declare the num array as float or double if there are any precision value

for(int i = 0; i < N; i++)

{

D += num[i];

}

D /= N;

int arr[N+2];

for(int i = 0; i < N; i++)

{

arr[i] = (num[i] - D)^2; //square the difference.

}

int F = 0; //if precision value is accepted then declare F as float or double not int.

for(int i = 0; i < N; i++)

{

F += arr[i];

}

F /= N;

F = sqrt(F); //use #include <cmath> in your header file list so that you can use sqrt() function or simply use #include <bits/stdc++.h>

cout<<F<<endl;

- Thanks

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

How do you write standard deviation in words?

Exactly as in the question: standard deviation!


How do you write in standard words?

Exactly as in the question: standard deviation!


How do you write a program in data structures to calculate mean cofficient of variation and standard deviation?

To calculate the mean, coefficient of variation, and standard deviation in a program, you first need to collect the data into an appropriate data structure like an array or a list. Then, compute the mean by summing all the data points and dividing by the number of points. The standard deviation can be calculated by finding the square root of the average of the squared differences between each data point and the mean. Finally, the coefficient of variation is obtained by dividing the standard deviation by the mean and expressing it as a percentage.


What is the average age a girl hits puberty also write stander deviation?

The average age is 11 to 12 years of age. Standard deviation is 2 years.


How do write numbers in standard form?

Writing numbers in standard form is writing numbers regular. For example One million in standard form is 1,000,000.


Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


How do you write a standard basic program?

That really depends on what sort of program you are trying to build, what do you want the program to do?


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


How do you write a program in objective c numbers 1-100 prime numbers?

fdsgfhgdfhgdf


Could you Write a program for 8086 microprocessor that displays on the monitor the average of 2 numbers from an array?

How to write a program for mouse in microprocessor?


What does it mean to show a number in standard form?

to write it in numbers