Skip to content

Instantly share code, notes, and snippets.

@jamc92
Created February 22, 2015 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamc92/d128f842bb28c30c53e5 to your computer and use it in GitHub Desktop.
Save jamc92/d128f842bb28c30c53e5 to your computer and use it in GitHub Desktop.
JS - Fahrenheit to Celsius
<!--@authot Javier Madrid-->
<!DOCTYPE html>
<html>
<head>
<title> De Fahrenheit a Celsius</title>
</head>
<body>
<script>
//Asignando valor a variable
var cTemp = 100;
// Transformando a Fahrenheit
var hTemp = ((cTemp * 9) / 5) + 32;
//Escribiendo desde el DOM
document.write("Temperatura en Celsius: " + cTemp + " grados <br>");
document.write("Temperatura en Fahrenheit: " + hTemp + "grados");
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment