76 409
Assignments Done
Successfully Done
In May 2019

Answer to Question #16096 in C++ for Chinny

Question #16096
Write a C++ program that asks the user for 10 integers and prints their SUM and their Average.
Expert's answer
using namespace std;

int a[10], sum=0;

void main(){
cout<<"enter 10 integers:\n";
for (int i=0; i<10; i++) cin>>a[i];
for (i=0; i<10; i++) sum += a[i];
cout<<"The sum is "<<sum<<"\nThe average is "<<sum/10.0<<"\n";

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions