Search This Blog

Sunday, 5 February 2017

PROGRAM TO CONVERT TEMPERATURE (F TO C)


import java.io.*;
 
class ConvertTemp
{
    public static void main() throws IOException
    {
        InputStreamReader ir=new InputStreamReader(System.in);
 
        BufferedReader br=new BufferedReader(ir);
 
        double c=0.0;
 
        double f;
 
        System.out.println("Enter the Number: ");
 
        f=Double.parseDouble(br.readLine());
 
        c=(5/9)*(f-32);
 
        System.out.println("The temperature in Centigrade is: "+c);
    }
}

No comments:

Post a Comment

Make a JAVA program for a Toystore. This program suggest the toy based on the inputs users gives like age , gender , etc

 //editor used - IntelliJ IDEA package ToyStore; import javax.swing.*; import java.awt.event.*; import java.util.Scanner; //here you can edi...