Email: Password:       Forgot Password 
    .netCodeSG
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
 
TECHNOLOGIES:
 

Change Fahrenheit To Centigrade

Article:
Viewed:  991 
Posted On:  24/07/2013 03:40:11 
Hi all,With the help of this article i am going to tell you that how we can change the temprature from fahrenheit to centigrade ........in java 

 

Below is my code:


import java.util.Scanner;
class temprature
{
public static void main(String s[])
{
int a,b;
System.out.println("enter temprature in Fahrenheit ");
Scanner scan=new Scanner(System.in);
a=scan.nextInt();
System.out.println("you entered temprature ="+a);
b=(9*a)/5+32;
System.out.println("temprature in centigrate ="+b);
}
}

  Step 1:
  After writing this in notepad save the file with the name followed by (.java) for eg.I saved it with temprature.java
  
 Step 2 : 
Open command prompt 

 Step 3 : 
Write javac temprature.java - Press Enter for compilation

 Step 4 : 
Write java temprature for execution

Output:

Change Temp.png

  Comment:
         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us