#include <iostream>
using namespace std;
int main()
{
int arr[10],n,i,sum=0;pro=1;
cout<<"Enter size of the array";
cin>>n;
cout<<"\nEnter the elements of array: ";
for(i=0;i<n;i++)
cin>>arr[i];
for(i=0;i<n;i++)
{
sum+=arr[i];
pro*=arr[i];
}
cout << "\nSum of array elements :" <<sum;
cout << "\nProduct of array elements: " << pro;
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: