Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- firefoxik
- Date:
- 2021-04-17
- Revision:
- 0:3f1c5a906dc0
- Child:
- 1:a388472c17f4
File content as of revision 0:3f1c5a906dc0:
//Fibanocci
#include "mbed.h"
void Fibanocci(int N){
int i = 0;
//Tried up to 50, but at 47, unsigned int number is overflowed showing negative result
// so I changed to long long
unsigned long long j = 1;
unsigned long long k = 0;
unsigned long long fib = 0;
while (i<=N){
printf("Fibanocci(%d) = %lld\n", i, fib);
fib = j + k;
j = k;
k = fib;
i++;
}
}
int main()
{
Fibanocci(50);
while(true) {
}
}