Java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter temperature in Celsius: ");
double temp = sc.nextDouble();
if (temp < 10) {
System.out.println("Cold");
} else if (temp <= 30) {
System.out.println("Moderate");
} else {
System.out.println("Hot");
}
sc.close();
}
}Output
Enter temperature in Celsius: 35 Hot
We define simple ranges: below 10 as cold, 10–30 as moderate, above 30 as hot.