At Westonci.ca, we provide reliable answers to your questions from a community of experts. Start exploring today! Discover in-depth solutions to your questions from a wide range of experts on our user-friendly Q&A platform. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.

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


Sagot :

Answer:

Answered below

Explanation:

//Program is written in Java.

public void first three elements(int[] nums){

int I;

//Check if array has up to three elements

if(nums.length > 3){

for(I = 0; I < nums.length; I++){

while (I < 3){

System.out.println(nums [I]);

}

}

else{

System.out.print("Array does not contain up to three elements");

}

}

}