Write a program in java to store the computer marks of 75 students and find out the position of the highest and lowest marks.
Answers
Answered by
0
Answer:
import java.util.*;
class Brainly {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
ArrayList<Integer> list = new ArrayList<Integer>();
System.out.println("Enter the marks of all 75 students:");
for(int i = 0; i < 75; i++){
list.add(sc.nextInt());
}
int max = Collections.max(list);
int min = Collections.min(list);
System.out.println(list.indexOf(max));
System.out.println(list.indexOf(min));
}
}
Explanation:
Similar questions