summaryrefslogtreecommitdiff
path: root/examples/gfcc/fibonacci.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gfcc/fibonacci.c')
-rw-r--r--examples/gfcc/fibonacci.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/gfcc/fibonacci.c b/examples/gfcc/fibonacci.c
new file mode 100644
index 000000000..80e8a0d5c
--- /dev/null
+++ b/examples/gfcc/fibonacci.c
@@ -0,0 +1,18 @@
+int mx () {
+ return 5000000 ;
+} ;
+
+int main () {
+ int lo ; int hi ;
+ lo = 1 ;
+ hi = lo ;
+ printf("%d",lo) ;
+ {
+ while (hi < mx()) {
+ printf("%d",hi) ;
+ hi = lo + hi ;
+ lo = hi - lo ;
+ }
+ }
+ return ;
+} ;