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.

Respuesta :

Answer:

Following are the program in c language

#include <stdio.h> // 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 .