Ask Question
2 April, 15:23

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. 2 April, 18:10
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers