64 609
Assignments Done
99,1%
Successfully Done
In September 2018

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
#include<iostream>
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";
system("pause");
}




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