Ask Question
27 August, 21:38

Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime = {800, 775, 790, 805, 808}, print:

800

775

790

Note: These activities may test code with different test values. This activity will perform two tests, the first with a 5-element array (int runTimes[5]), the second with a 4-element array (int runTimes[4]). See How to Use zyBooks.

+4
Answers (1)
  1. 27 August, 23:33
    0
    Following are the program in c language

    #include / / header file

    int main () / / main function

    {

    int runTimes[5]={800,775,790,805,808}; / / declared the array

    for (int k = 0; k < 3; k++) / / itearting the loop

    {

    printf ("/n%d", runTimes[k]); / / display array

    }

    return 0;

    }

    Output:

    800

    775

    790

    Explanation:

    Following are the description of program

    Declared a array "runTimes[5]" as the" int " type and store the five integer value in it. After that iterating the for loop from the 0 index to the less then 3 index. Inside the for loop we print the corresponding value that are stored in the particular index in the nextline.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime = {800, ...” 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