Question
program to convert celsius to fahrenheit
Share code with your friends
Share on whatsapp
Share on facebook
Share on twitter
Share on telegram
Code
import java.util.Scanner;
public class celsiusToFahrenheit
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter Celsius value");
double celsius=sc.nextDouble();
/* fahrenheit = ((celsius*9)/5)+32 */
double f=((celsius*9)/5)+32;
System.out.println("fahrenheit value="+f);
}
}