Hi I have all tasks working accept task number 4. My code does take in 5 variables, and searches through each for the minumun number. The output's right "-79", but I'm still getting an error. Your help is appreciated.
package com.codegym.task.task05.task0531;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Improving functionality
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
int d = Integer.parseInt(reader.readLine());
int e = Integer.parseInt(reader.readLine());
int minimum = min(a, b, c, d, e);
System.out.println("Minimum = " + minimum);
}
public static int min(int a, int b, int c, int d, int e){
int lowest = 0;
if(a < b && a < c && a < d && a < e){
lowest = a;
}else if (b < a && b < c && b < d && b < e){
lowest = b;
}else if (c < b && c < d && c < a && c < e){
lowest = c;
}else if (d < a && d < b && d < c && d < e){
lowest = d;
}else if (e < a && e < b && e < d && e < c){
lowest = e;
}
return lowest;
}
}