Created
February 9, 2012 01:22
-
-
Save scsibug/1776230 to your computer and use it in GitHub Desktop.
Count to ten
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(count_ten). | |
-export([count_ten/0]). | |
% Write a unction that uses recursion to count to ten. | |
count_ten() -> cnt(0). | |
cnt(X) -> | |
io:format("~p~n",[X]), | |
if (X < 10) -> cnt(X+1); | |
true -> nothing | |
end. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment