How this can return the minimum of a,b,c,d?
a = min(a, b)
c = min(c, d)
return min(a, c)
I need explanation for this.
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Gellert Varga
4 April 2020, 13:28
There is an inbuilt Math.min() method in java which returns the minimum of the two sent numbers.
https://www.geeksforgeeks.org/java-math-min-method-examples/
But your task here is not to use this, but to write your own min() method.
Use for example if-else conditions, and smaller-larger test for check two numbers, and the return keyword to send back the result.
If you have a concrete question, write it. And please enclose your program.
+1