Write code segments that read temperature in Celsius and convert to Fahrenheit using
the formula Fahrenheit = Celsius * (9/5) + 32. For example, if the input is 50 then
the output will be 122.0 and if the input is 74 then the output will be 165.2.
Answers
Answered by
2
import java.util.*;
class convert
{
void main()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the temp in celcius for the conversion");
double n = s.nextDouble();
double temp = 0.0;
temp = n * (9/5.0) + 32.0 ;
System.out.println("The converted temp in farhenite is " +temp);
}
}
Hope u liked it
Similar questions