package com.codegym.task.task02.task0216;
/*
Minimum of three numbers
*/
public class Solution {
public static int min(int a, int b, int c) {
//write your code here
int m;
if ((a < b) && (b < c)) {
return a;
}
else if ((b < a) && (b < c)) {
return b;
}
else if ((c < b) && (c < a)) {
return c;
}
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));
}
}
I cant find what is wrong with this code
Resolved
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
17 December 2019, 20:00
Make sure, in the future, that you attach your solution to posts when asking for help. There is a lot of information that will help us help you. Otherwise, see my post here:
https://codegym.cc/help/5432
0
Denis Majorský
17 December 2019, 19:24
Update:
Currently working with this but still issue to fulfill requirements.
0
Artem Divertitto Senior Android Developer at United Tech
19 December 2019, 12:43solution
For test:
1
3
2
+2
Shuy
20 December 2019, 07:07
Use the test Tiym Divertitto gave you, if that doesnt help, look at your first if statement. The other 2 If's follow a certain pattern, just the first one doesnt.
+1