"Don't compare me with others!" she cried. But comparisons are unavoidable in this world. Especially in programming. Let's take three numbers, look at them, and figure out which one is the smallest. We'll do this using a program, more precisely, a special min method that calculates which number is smaller than the other two.
Minimum of three numbers
- 7
Locked
Comments (89)
- Popular
- New
- Old
You must be signed in to leave a comment
Nuhazet
23 April, 08:51
Si te está dando problemas esta tarea, prueba con comparar también por igualación ( a <= b && a <= b )
Mucho ánimo!
If you are having problems with this task, try to compare also by equalization ( a <= b && a <= b ).
Cheer up!
0
Jeongmin
23 September 2021, 11:55
It was tricky to achieve the goal using if, && operator, else if. There were two same values and it made my program working the wrong way.
Instead, I took a two-step approach. First, compare a and b, then save min. Next, compare min and c.
+1
Anonymous #10795220
23 August 2021, 00:13
1
-3
3
5
Esta es la salida cual es el error , por favor?
0
Steve C. Ands
16 November 2021, 21:52
Me sucede lo mismo el método está bien y sale eso. Y resulta en error.
0
Anonymous #10795220
23 August 2021, 00:12
No se que esta mal el resultado esta bien!!!
0
Víctor Alfonso Martínez Gómez
10 August 2021, 22:31
if (a
0
Víctor Alfonso Martínez Gómez
10 August 2021, 22:31
if (a una pequeña ayuda para iniciar su código.
0
Toka
10 July 2021, 14:07
I solved the task with 2x Math.min() method and it works :)
+1
Jose Antonio Fernández G
4 June 2021, 15:56
i solved the task creating another method min(int a, int b). You can create a method who compare the values of "a" and "b" to see which of them is the minimum. After you can declare a new variable on method min(x, x,x) referenced to the previus method "m2 = min(x,x)" and do the comparation
+4
Agustín Fernández
31 May 2021, 12:03
Agree with Carlos! We got no info at all about " ? : " Try to resolved it with if else statement but it did not achieve last requirement. Thought this course would be better :(
0
Marcus Lindbloom
18 May 2021, 19:28
I get the output 1, -3, 3, 5 which should be correct? Or am I misunderstanding something?
+1
Toka
10 July 2021, 14:06
yes
0