MIPI_BaseC_WebinarFRTK/07_Lecture07/10_fibonachi_25.c

16 lines
208 B
C
Raw Permalink Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
int fibonachi(int n)
{
if(n<=0)
return 0;
if(n==1)
return 1;
return fibonachi(n - 1) + fibonachi(n - 2);
}
int main(void)
{
printf("%d\n",fibonachi(6));
}