#include<iostream>
using namespace std;
int main ()
{
int arr[14], n, i, sum = 0;
cout << "Enter the size of the array : ";
cin >> n;
cout << "\nEnter the elements of the array : ";
for (i = 0; i < n; i++)
cin >> arr[i];
for (i = 0; i < n; i++)
{
sum += arr[i];
}
cout << "\nSum of array elements : " << sum;
return 0;
}
Dee_2_dee 0 Newbie Poster
Dee_2_dee 0 Newbie Poster
Dani 4,312 The Queen of DaniWeb Administrator Featured Poster Premium Member
rproffitt 2,662 "Nothing to see here." Moderator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.