60 429
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #5288 in C++ for aimelawan

Question #5288
1. Make a program that calculates the average and standard deviation of marks of 10 students
Expert's answer
# include<iostream.h>
# include<conio.h>
void main(){
float a[10], ave, dev;
int i;
for (i=0;i<=9;i++){
& cout<<"Enter a mark of student "<<i+1<<": ";
& cin>>a[i];
}
ave = 0;
for (i=0;i<=9;i++) ave = ave + a[i];
ave = ave/10;
dev = 0;
for (i=0;i<=9;i++) dev = dev + (a[i]-ave)*(a[i]-ave);
dev = sqrt(dev/10);
cout<<"Average is "<<ave<<"\n"<<" Standard deviation is "<<dev;
getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions