My last condition is not verifying .It's running with even 1111 and displaying 1 but not verifying;
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 {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = s.nextInt();
int c = s.nextInt();
int d = s.nextInt();
//Find Maximum Conditions
if((a>b) && (a>c) && (a>d))
{
System.out.println(a);
}
//For b
if ((b>a) && (b>c) && (b>d)) {
System.out.println(b);
}
//For c
else if ((c>a) && (c>b) && (c>d)) {
System.out.println(c);
}
//For d
else if ((d>a) && (d>c) && (d>b)) {
System.out.println(d);
}
else if(a==b && b==c && c==d)
{
System.out.println(b);
}
}
}