The code does return the maximum of the numbers but when I verify it, it displays that I have not meet all the requirements. It is the third requirement that it does not accept: The program should display the maximum of four numbers.
Can anybody see what the issue is?
Thanks.
package com.codegym.task.task04.task0419;
/*
Maximum of four numbers
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner input = new Scanner (System.in);
int a = input.nextInt();
int b = input.nextInt();
int c = input.nextInt();
int d = input.nextInt();
if (a < b){
a = b;
}else if (a < c){
a = c;
}else if ( a < d) {
a = d;
}
System.out.println(a);
}
}