Java

Program to convert Fahrenheit temperature into Celsius temperature using command line

By June 3, 2016 November 9th, 2016 No Comments

/**** JAVA 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:




Screenshot (277)

Leave a Reply