Write a C++ program that asks the user for 10 integers and prints their SUM and their Average.
1
Expert's answer
2012-10-10T11:23:53-0400
#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"); }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment