WAP to input three numbers and print the average of the largest two numbers.
No spam please
Answers
Answered by
0
qwertyuiopasdffghjklz
Answered by
0
Answer:
public class Average{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int [] ia=new int[3];
for(int i=0;i<ia.length;i++){
ia[i]=sc.nextInt();
}
Arrays.sort(ia);
System.out.println(ia[length-1]+ia[length-2]);
Explanation:
Similar questions