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 herint min;
int mon;
if((a <= b) && (b <= c))
mon = a;
else
mon = c;
return mon;
}
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));
}
}
Only last condition is wrong....i dont return the minimum of a,b and c
Resolved
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Serghei
20 February 2019, 12:36solution
I solve it ...don't need help. Thx
+2