C_Algorithms 2.0.0
Documentation
Loading...
Searching...
No Matches
Functions
recursiveFib.c File Reference
#include <stdio.h>
#include "recursiveFib.h"
Include dependency graph for recursiveFib.c:

Go to the source code of this file.

Functions

int RecFib (int n)
 RecFib is a function wihich can calculate the fibonacci number by calling it self n times.
 
void RecursiveFib (int number)
 Prints the return value of the called function RecFib.
 

Function Documentation

◆ RecFib()

int RecFib ( int n)

RecFib is a function wihich can calculate the fibonacci number by calling it self n times.

Parameters
nInput as a sting
Returns
int returns the nth fibonacci number

Definition at line 13 of file recursiveFib.c.

14{
15 if(n <= 2)
16 return 1;
17 return RecFib(n - 1) + RecFib(n - 2);
18}
int RecFib(int n)
RecFib is a function wihich can calculate the fibonacci number by calling it self n times.

References RecFib().

Referenced by RecFib(), and RecursiveFib().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecursiveFib()

void RecursiveFib ( int number)

Prints the return value of the called function RecFib.

Parameters
number

Definition at line 25 of file recursiveFib.c.

26{
27 printf("%d\n", RecFib(number));
28}

References RecFib().

Referenced by FunctionCall().

Here is the call graph for this function:
Here is the caller graph for this function: