wap in Java to accept a temperature in celcius scale and print in its Fahrenheit equivalent with message
Answers
Answered by
7
import java.util.Scanner;
public class Temperature
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter Temperature in Degree Celsius: ");
double tc = sc.nextDouble();
double tf = 9*tc;
tf = tf/5;
tf += 32;
System.out.println("Temperature in Degree Fahrenheit is: "+tf);
}
}
public class Temperature
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter Temperature in Degree Celsius: ");
double tc = sc.nextDouble();
double tf = 9*tc;
tf = tf/5;
tf += 32;
System.out.println("Temperature in Degree Fahrenheit is: "+tf);
}
}
QGP:
Hope it helps.
Similar questions