Java Program to convert temperature from Degree to Fahrenheit


Program complied with Netbeans IDE you can also use JDK and compile in command prompt .

PROGRAM:

package celtofar;
import java.io.*;
public class celtofar {
public static void main(String[] args) throws IOException {
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the temperature in celcius: ");
double cel=Double.parseDouble(in.readLine());
double far=(cel*9)/5+32;
System.out.println("The Fahrenheit is "+far);

}
}


OUTPUT:


Enter the temperature in celcius:
40
The Fahrenheit is 104.0

0 comments:

Post a Comment

If You Are Asking Some Question On This Comment Then Click On Subscribe by email Link