Writing a sample program in Erlang

Nivedita Vattipalli
The Complete Guide to Erlang
1 min readFeb 16, 2019
  1. You can write the program in notepad and save it with .erl execution.
  2. Example: Program to find the factorial of a given number.

3. Once the program is saved with .erl extension, open Erlang shell and navigate to the folder where the program is saved using the command cd(“<<folder where .erl program is saved>>”).

NOTE: All the erlang commands should end with a full-stop(.)

4. Compiling the program: Use the command c(<<filename>>). to compile the program. In this case it is, c(factorial).

5. Once the program is successfully compiled, give the command numfactorial:factorial(5) to execute the program. In this case, we are giving number 5 to find the factorial of it.

--

--