C_Algorithms
2.0.0
Documentation
Loading...
Searching...
No Matches
misc
src
recursiveFib.c
Go to the documentation of this file.
1
// Recursive function to calculate the fibonacci row
2
3
#include <stdio.h>
4
5
#include "
recursiveFib.h
"
6
13
int
RecFib
(
int
n)
14
{
15
if
(n <= 2)
16
return
1;
17
return
RecFib
(n - 1) +
RecFib
(n - 2);
18
}
19
25
void
RecursiveFib
(
int
number)
26
{
27
printf(
"%d\n"
,
RecFib
(number));
28
}
RecursiveFib
void RecursiveFib(int number)
Prints the return value of the called function RecFib.
Definition
recursiveFib.c:25
RecFib
int RecFib(int n)
RecFib is a function wihich can calculate the fibonacci number by calling it self n times.
Definition
recursiveFib.c:13
recursiveFib.h
Generated by
1.10.0