Mercurial > lcfOS
annotate examples/c3/functions.c3 @ 387:34ac19044b8a
Hello world with paging in emulator
author | Windel Bouwman |
---|---|
date | Thu, 01 May 2014 22:09:18 +0200 |
parents | 158068af716c |
children |
rev | line source |
---|---|
251 | 1 |
2 /* | |
3 Demo of function usage | |
4 */ | |
5 | |
286 | 6 module functiondemo; |
251 | 7 |
8 function void main() | |
9 { | |
10 var int a, b, c; | |
11 a = 3; | |
12 b = a; | |
13 a =3; | |
14 b = fib(a + 9); | |
15 sum(a, b); | |
16 } | |
17 | |
18 function int fib(int x) | |
19 { | |
20 return fib(x - 1) * x; | |
21 } | |
22 | |
23 function int sum(int a, int b) | |
24 { | |
25 return a + b; | |
26 } | |
27 |