Skip to content

Instantly share code, notes, and snippets.

@isauravmanitripathi
Last active April 2, 2019 00:02
Show Gist options
  • Select an option

  • Save isauravmanitripathi/cbd4981a9708c00256a0b38c9221b6b9 to your computer and use it in GitHub Desktop.

Select an option

Save isauravmanitripathi/cbd4981a9708c00256a0b38c9221b6b9 to your computer and use it in GitHub Desktop.
public class weather {
public static void main(String [] args) {
float fah = 86;
System.out.println(fah + "Degrees Fahrenheit is...");
// TO convert Fahrenheit into celsius
//Begin by subtracting 32
fah = fah - 32;
// divide the answer by 9
fah = fah / 9;
//Multiply that answer by 5
fah = fah * 5;
System.out.println(fah + "degrees celsius\n");
float cel = 33;
System.out.println(cel + "Degrees celsius is....");
// To convert Fahrenheit into Celsius
// Begin by subtracting 32
cel = cel * 9 ;
// divide the answer by 9
cel = cel / 5;
//multiply that answer by 5
cel = cel + 32;
System.out.println(cel + "Degrees Fahrenheit: ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment