DEV1.1
TD
TP01
TP02
TP03
TP04
TP05
TP06
TP07
TP08
TP09
TP10
TP11
TP12
TP13
TP14
curiosité.c
fibo.c
listchainee.c
phases.c
power.c
rainbow.c
sierpinski.c
tableau.c
TP15
random
DEV2.1
DEV3.1
WEBBE
.gitignore
Gantt.gan
README.md
projet.jar
32 lines
367 B
C
32 lines
367 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
int fibonacci(int n)
|
||
|
{
|
||
|
if (n <= 1)
|
||
|
{
|
||
|
return 1;
|
||
|
}else
|
||
|
{
|
||
|
return(fibonacci(n-1)+fibonacci(n-2));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void fibonacci2(int n)
|
||
|
{
|
||
|
if (n!=0)
|
||
|
{
|
||
|
fibonacci2(n-1);
|
||
|
printf("%d\n",fibonacci(n));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
int main(int argc, char const *argv[])
|
||
|
{
|
||
|
/*printf("%d\n", fibonacci(5));*/
|
||
|
fibonacci2(4);
|
||
|
printf("%d",!0);
|
||
|
return 0;
|
||
|
|
||
|
}
|