Computer Science, asked by dadsdoll3402, 1 year ago

What is the output of the following code?

public class Test{ public static void main(String args[]){ double[] myList = {1, 5, 5, 5, 5, 1}; double max = myList[0]; int indexOfMax = 0; for(int i = 1; i < myList.length; i++){ if(myList[i] > max){ max = myList[i]; indexOfMax = i; } } System.out.println(indexOfMax); } }
A.0
B.1
C.2
D.3

Answers

Answered by sasat74
4
Hola friends...
=============

&lt;b&gt;&lt;i&gt;Option B :- 1

is the correct answer.....
Answered by Anonymous
0
heya..

Here is your answer...

What is the output of the following code?

B.1

It may help you..☺☺
Similar questions