The Task requirement is to display the maximum number.
Other task conditions are satisfied, just the third one is not...why?
What's wrong in the code...can anyone explain ??
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 sc=new Scanner(System.in);
int n1=sc.nextInt();
int n2=sc.nextInt();
int n3=sc.nextInt();
int n4=sc.nextInt();
if(n1>=n2 && n1>=n3 && n1>=n4){
System.out.println(n1);
}
else if(n2>=n1 && n2>=n3 && n2>=n3){
System.out.println(n2);
}
else if(n3>=n4){
System.out.println(n3);
}
else if(n4>=n4){
System.out.println(n4);
}
}
}