Fib , lab2 complete

Dependencies:   mbed C12832

Revision:
0:f20f7680069b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 28 09:47:02 2021 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"     // Stephen Reidy; lab2
+
+int j=1, k=0, fib=0;  // Integers initialised 
+int N = 10;           // Integers initialised 
+
+int fibb(int inp)
+{
+    if (inp == 0)           // if statemant to return 0
+        return 0;
+    else if (inp == 1)      // else if statemant to return 1
+        return 1;
+    else                    // else to return fibb calculation
+        return (fibb(inp -1) + (inp -2));
+}
+
+int main()                         //Main structure 
+{
+    for (int i=0; i<10; i++)       //for loop, including conditions
+    printf("%d, ", fibb(i));       //fibb printout (i), PC (Tera term)
+    printf("\r\n");                
+}