Ask Question

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

+4
Answers (1)
  1. 15 June, 17:41
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers