Code:
int total = 0; //used to store the sum of the values in the array
for (int a = 0; a <= 12; a++) //use a for loop to access the values present in the array
{
if (array[a] < 0) //if the user enters a negative number (to exit program) it skips that value
{
continue;
}
cout << "Array Index " << a << " Holds Value: " << array[a] << endl << endl; //prints out array index and the corresponding value
total += array[a]; //total = total + the values in the array
cout << "Total: " << total << endl; //display total
EDIT: If you have learnt functions, you should probably use them. Makes it really easy to understand and organized.