Answer:
Following are the code
int k;// variable declaration
for ( k = 0; k < yearlySalesTotals.Length; k++) // iterating the loop
{
cout<<yearlySalesTotals[k]; // accesing the each element
}
Step-by-step explanation:
Following are the description of code
- In this, we declared a variable "k" of "int" type.
- initialized the value of "k" to 0 in the for a loop.
- Set the condition in the loop for controlling and accessing the element of the array i.e yearlySalesTotals.Length;
- Inside the loop, we print the value of array in one by one.
- Increment the value of "k" by 1.