-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample_program.ex
29 lines (22 loc) · 932 Bytes
/
example_program.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
defmodule ModuleName do
# TODO: Change the name of the module to FirstExercise
def add_two_numbers(x, y) do
x + y
end
# TODO: Write a function adding a three numbers under here:
# TODO: make the "hello_world" function the first one in the module (Just move it above all other functions)
def hello_world() do
# This prints the text "Hello world" in the console.
IO.puts("Hello world")
end
# TODO: create a function 'console_print', that prints the text "First console output!".
# TODO: concatenate the string "!" (literally exclamation mark) at the end of the greeting
def greeting(name) do
"Hello, " <> name
end
# TODO: write the function definition of the function below
def power_of_two(number) do
# Write the function definition here. Examples: 'power_of_two(3)' should return '9', 'power_of_two(4)' should return '16'
end
# TODO: remove each "TODO", after it is done
end