Hi!
Can somebody help me with this? I don't want the solution. If you can I just want from you to show me the right way of thinking so I can figure out this task by myself.
package com.codegym.task.task02.task0217;
/*
Minimum of four numbers
*/
public class Solution
{
public static int min(int a, int b, int c, int d)
{
//write your code here
int x = (Math.min((Math.min((Math.min(a, b)), c)), d));
return x;
}
public static int min(int a, int b)
{
//write your code here
int z = (Math.min(a, b));
return z;
}
public static void main(String[] args) throws Exception
{
System.out.println(min(-20, -10));
System.out.println(min(-20, -10, -30, -40));
System.out.println(min(-20, -10, -30, 40));
System.out.println(min(-40, -10, -30, 40));
}
}