c language

### c++ program to find the sum and average of one dimensional integer array

- by
**techexperto** - 3 months ago
- 0 comments

__QUESTION__

Write the c++ program to find the sum and average of one dimensional integer array

__PROGRAM__

#include <iostream>

#include <conio.h>

using namespace std;

int main()

{

int Arr[10],n,sum=0;

cout<<“Enter number of elements = “;

cin>>n;

for(int i=0;i<n;i++)

{

cout<<“Enter element “<<i+1<<“:”;

cin>>Arr[i];

}

for(int i=0;i<n;i++)

sum+=Arr[i];

cout<<“\nThe sum of Array is :”<<sum;

cout<<“\nThe average of Array is :”<<sum/n;

getch();

return 0;