public static void main (String[] args) {
for (double f=0; f<=20;f++) {
System.out.println(f+":Degrees Fahrenheit converted to Celsius = "+ celsius(f));
}
}
public static double celsius (double fahrenheit) {
double cels=(fahrenheit-32)/(5/9);
return cels;
}
With this program I'm trying to convert Fahrenheit to Celsius, and when I call method Celsius to my main when I run the program the end result for Celsius is always -infinity. What am I doing wrong?