Here is a Java Program to tells whether the Temperature is Hot or not
Enter the temprature in Celcious = 31
Whether is Hot
import java.util.*;
class weather{
public static void main (String arg[]) {
Scanner in=new Scanner (System.in);
int a;
System.out.print ("\n\t Enter the temprature in Celcious = ");
a=in.nextInt();
if (a<=20)
System.out.print ("\n\t Whether is Cool ");
else if (a<=30 && a>=21)
System.out.println ("\n\t Whether is Fine ");
else if (a<=40 && a>=31)
System.out.println ("\n\t Whether is Hot ");
else
System.out.println ("\n\t Whether is very Hot ");
}
}
Output of Above Java ProgramEnter the temprature in Celcious = 31
Whether is Hot