#include <iostream>
using namespace std;
int main()
{
int array[num]; // Declare an array of size num
int sum = 0; // Variable to store the sum
// Ask the user for the number of elements
cout << "Enter the number of elements: ";
cin >> num;
// Input elements
cout << "Enter " << num << " elements: ";
for (int i = 0; i < num; i++)
{
cin >> array[i]; // Read elements into array
sum += array[i]; // Add each element to sum
}
// Output the sum
cout << "Sum of array elements: " << sum << endl;
return 0;
}
