64 693
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #26056 in C++ for muhammad ismail iqbal

Question #26056
Write a C++ program to find the sum and average of one dimensional integer array
Expert's answer
#include <iostream>

using namespace std;

void main()
{
intA[10]={10,22,3,44,5,55,34,4,43,4};
int length= 10;
int sum =0;
int avg =0;

for(int i =0; i < length; i++)
{
sum+= A[i];
}

avg = sum /length;

cout<< "Sum: " << sum << endl;
cout<< "Average: " << avg << endl;
}

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