answersLogoWhite

0


Best Answer
Program in CHere is a program in C to calculate mean variance and standard deviation:

#include

#include

void main()

{

float a[50],sum=0,vsum=0,mean,variance,sd;

int n,i;

printf("Enter the no of valus");

scanf("%d",&n);

printf("Enter the no of valus");

for(i=0;i

{

scanf("%f",&a[i]);

}

for(i=0;i

{

sum=sum+a[i];

mean=sum/n;

}

for(i=0;i

{vsum=vsum+((a[i]-mean)*(a[i]-mean));

variance=vsum/(n-1);

sd=sqrt(variance);

}

printf("Arithmeti mean=%f",mean);

printf("Variance=%f",variance);

printf("Standard=%f",sd);

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a c program to calculate mean variance and standard deviation?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Other Math

What is the formula for finding the standard deviation of two independent random variables multiplied together?

The question is excellent. If two independent random variable with different pdf's are multiplied together, the mathematics of calculating the resultant distribution can be complex. So, I would prefer to use Monte-Carlo simulation to calculate the resultant distribution. Generally, I use the Matlab program. If this is not a satisfactory answer, it would be good to repost your question.


What z value corresponds to 17 percent of the data between the mean and the z value?

I believe your question is to find a range going from the mean to a z-value on the standard normal distribution that corresponds to 17% of the area. A normal distribution goes from values of minus infinity to positive infinity. A standard normal distribution has a mean of 0 and an standard deviation of 1. It is usually best if you draw a diagram, in this case a bell shape curve with mean = 0. The area to the left of the mean is 50% of the total area. We find a z value that corresponds to 67% (50% + 17%) of the area to the left of this value. This can be done either with a lookup table or a spreadsheet program. I prefer excel, +norminv(0.67) = 0.44. The problem could also be worded to find the area going from a z-value to the mean. In this case, we must find a z-value that corrsponds to 33% (50-17). Using Excel, I calculate +norminv(0.33) = -0.44.


What is the standard output device in c plus plus?

Not defined by the language, it depends on the OS/platform/context. Usually, it is the terminal(emulation) or DOS-shell or console in which the program runs.


Blank program?

_______ program


What part of speech is program?

Programs is a noun (plural form of program) and a verb (third person singular conjugation of program).

Related questions

How do you calcuate standard deviation?

A worked out example is shown in the related link. There are a number of calculators that do this automatically. Also, the Excel program (and most other spreadsheet programs) include a standard deviation function. In Excel, it is +stdev(a1:a10) for a list of numbers from a1 to a10.


How many days after a program deviation occurs should a program manager inform the milestone decision authority?

90


What website or free program would you use to convert recipes between US standard and metric measures and calculate nutritional values for those recipes?

Dinotube.com


What is the formula for finding the standard deviation of two independent random variables multiplied together?

The question is excellent. If two independent random variable with different pdf's are multiplied together, the mathematics of calculating the resultant distribution can be complex. So, I would prefer to use Monte-Carlo simulation to calculate the resultant distribution. Generally, I use the Matlab program. If this is not a satisfactory answer, it would be good to repost your question.


What is the relationshjip between a computer program and an algorithm?

A computer program can use a pre-programmed Algorith to calculate what you want it to calculate.


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?


Program to calculate area of triangle?

You don't need a program; the formula is b*h/2.


Write a program to calculate first?

int first= 1;


What is the program to calculate the area of a square?

base X height


What is the AFOSH standard for radio frequency radiation safety program?

AFOSH Standard 48-9


What is the answer to pennfoster exam 405560RR?

Naeyc program standard 4 states that early childhood program should


What are non standard risk?

A Non Standard risk is one that may not fall into a standard risk classification or it can be a risk that does not meet the qualifying criteria of a standard insurance program.