Saturday, July 27, 2013

java Program to convert Fahrenheit temperature into Celsius temperature

Program to convert Fahrenheit temperature into Celsius
temperature using command line

import java.lang.*;
import java.io.*;
class temp
{
public static void main(String a[])
{
try
{
DataInputStream dts=new DataInputStream(System.in) ;
float m=Float.parseFloat(a[0]);
double f;
f = ( ( 9 * m ) / 5 + 32 );
System.out.println("tempreture in fahrenheit ="+f);
}
catch(Exception x)
{
System.out.println(x.getMessage());
}
}
}
Output:
java Program to convert Fahrenheit temperature into Celsius temperature

No comments:

Post a Comment