#include<iostream>
using namespace std;
 int main ()
{
int n,a,i;

double sum=0;
double avg=0;

cout<<"\n Enter the number of element:\n";

cin>>n;

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

{

cout<<"Enter the " <<i+1<<" number:";

cin>>a;

sum =sum+a;
}
avg=sum/n;

cout<<"average of "<<n<<" number:"<<avg;

return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: