Answer:
for loop code:
int total=0;
for(int i=0;i<10;i++)
{
total + = value[i];
}
Step-by-step explanation:
By declaration we know that the array is of size 10 which means the index will start from 0.
The variable name to be used to store the sum is given as total
We will initialize total with zero so that no garbage value is used.
For loop will be used to access the elements of array and calculate the sum. The syntax of for loop is given as:
for (initialization; condition; increment/decrement)
{statement}
Code:
int total=0;
for(int i=0;i<10;i++)
{
total + = value[i];
}