write a program for it in java
wap to input the temperature in degree centigrade and convert it into degree fahrenheit........
please reply as fast as you can it's very urgent.....
ple....
Answers
Answer:
import java.io.*;
class temperature
{
public static void main(String args []) throwsIOException
{
int tf, tc;
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader (read);
System.out.println("Enter the temperature in farenheit");
tc=Integer.parseInt(in.readLine());
tf=(tc*1.8)+32;
System.out.printeln("The temperature is:"+tc);
}
}
instructions
[]these are Square brackets
throws io exception is with one space after string args
you can also use scanner one input
just check spaces if any might be wrong
rest is all correct
Explanation:
JAVA
public class Celsius.
{
public static void main (String args[])
{ float Fahrenheit, Celsius;
Fahrenheit = 43;
Celsius = ((Fahrenheit-32)*5)/9;
System.out.println("Temperature in celsius is: "+Celsius);