]> Joshua Wise's Git repositories - jwcc.git/blob - examples/test.c
Add the break.c example
[jwcc.git] / examples / test.c
1 int j = 0;
2
3 int fact(int num) {
4         if (num == 1)
5                 return 1;
6         return num * fact(num-1);
7 }
8
9 int testreturn() {
10         return j;
11 }
12
13 int main() {
14         int i = 5;
15         int iters = 0;
16         
17         printint(0);
18         i = 0;
19         while (i < 50000)
20                 i = i + 1;
21         printint(1);
22         
23         i = 0;
24         j = 50000;
25         while (i < j)
26                 i = i + 1;
27         printint(2);
28         
29         i = 0;
30         j = 50000;
31         while (i < testreturn())
32                 i = i + 1;
33         printint(3);
34         
35         printint(fact(10));
36         i = 5;
37         j = 0;
38         while (i > testreturn())
39         {
40                 printint(i*5);
41                 i = i - 1;
42                 iters = iters + 1;
43         }
44         return iters;
45 }
This page took 0.02804 seconds and 4 git commands to generate.