Ask Question
4 April, 00:34

Given a one-dimensional array named yearlySalesTotals that contains decimal values, code the first line of a foreach statement that will let you access each element in the array in a variable named yearlySalesTota

+2
Answers (1)
  1. 4 April, 00:53
    0
    Following are the code

    int k; / / variable declaration

    for (k = 0; k < yearlySalesTotals. Length; k++) / / iterating the loop

    {

    cout<
    }

    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.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Given a one-dimensional array named yearlySalesTotals that contains decimal values, code the first line of a foreach statement that will ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers