Am not sure what's wrong with my code. This outputs me the correct answer but I still fail to pass testing (as seen in the img below). Not sure if it's the logic flow or the syntax. If anyone can spot the error, do let me know! Much appreciated!
package com.codegym.task.task02.task0216;
/*
Minimum of three numbers
*/
public class Solution {
public static int min(int a, int b, int c) {
int d;
if (a >= b)
d = b;
if (b >= c)
d = c;
else
if (a >= c)
d = c;
else
d = a;
return d;
}
public static void main(String[] args) throws Exception {
System.out.println(min(1, 2, 3));
System.out.println(min(-1, -2, -3));
System.out.println(min(3, 5, 3));
System.out.println(min(5, 5, 10));
}
}