Programming Examples
Java program to find temperature category using Ternary Operator
Write a Java program that takes a temperature value as input and categorizes it as "Cold" if the temperature is below 10 degrees, "Warm" if it's between 10 and 30 degrees, and "Hot" if it's above 30 degrees using the ternary operator.
Solution
Output