Computer Science, asked by tiwariaryan25101, 1 year ago

write a jav program to convert fahrenheit to centigrate (hint : c = (5/9)*F-32)

Answers

Answered by Anonymous
23

Answer:

Java program to convert Fahrenheit to Celcius :

import java.util.* ;

class FahrenheitToCelsius

{

public static void main(String[] args)

{

float temperature;

Scanner in = new Scanner(System.in);

System.out.println("Enter temperature in Fahrenheit");

temperature = in.nextInt();

temperature = ((temperature - 32)*5)/9;

System.out.println("temperature in Celsius = " + temperature);

}

}

Answered by Anonymous
2

Explanation:

import java.util.*;

// Compiler version JDK 11.0.2

class Farentocel

{

public static void main(String args[])

{

double temp;

Scanner sc=new Scanner (System.in);

System.out.println("enter the temperature");

temp=sc.nextDouble();

System.out.println("celsius temp="+(

(temp-32)*5)/9);

}

}

Attachments:
Similar questions