66 861
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #5303 in C++ for anum

Question #5303
write a program which takes 10 floating points values from the user,save them in an array.then display the average of those values.
Expert's answer

# include<iostream.h>
# include<conio.h>
void main(){
float a[10], ave;
int i;
for (i=0;i<=9;i++){
& cout<<"Enter a number "<<i+1<<": ";
& cin>>a[i];
}
ave = 0;
for (i=0;i<=9;i++) ave = ave + a[i];
ave = ave/10;
cout<<"Average value is "<<ave;
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