Commit 605e3737 by Raul.Leemet

Upload new file

parent 10b7109f
Showing with 25 additions and 0 deletions
#include <stdio.h>
#include <stdlib.h>
int M[15];
int Fibonacci (int i)
{
if(M[i]>0)
return M[i];
if(i<=1)
return i;
M[i]=Fibonacci(i-1)+ Fibonacci(i-2);
return M[i];
}
int main() {
int n = 15;
int i;
for(i = 0;i<n;i++) {
printf("%d \n",Fibonacci(i));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment