Back
Close

Elixir - Conversor Celsius - Farenheit (version 1)

mat130517
1,307 views

Conversor Celsius - Farenheit

Programa conversor. Prueba para curso iniciación a Elixir página web.

defmodule Funciones do
def convertir(tipo, grados) when tipo =="aCel" do
(grados-32) * 5/9
end
def convertir(tipo, grados) when tipo =="aFah" do
(grados * 9/5) +32
end
end
IO.puts (Funciones.convertir("aCel",40))
IO.puts (Funciones.convertir("aFah",10))
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Tech.io mola!

If you want a more complex example (external libraries, viewers...), use the Advanced Elixir template

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants