1#include <stdio.h>
2
3int factorial(int n) {
4 //base case
5 if(n == 0) {
6 return 1;
7 } else {
8 return n * factorial(n-1);
9 }
10}
11
12int fibbonacci(int n) {
13 if(n == 0){
14 return 0;
15 } else if(n == 1) {
16 return 1;
17 } else {
18 return (fibbonacci(n-1) + fibbonacci(n-2));
19 }
20}
21
22int main() {
23 int n = 5;
24 int i;
25
26 printf("Factorial of %d: %d\n" , n , factorial(n));
27 printf("Fibbonacci of %d: " , n);
28
29 for(i = 0;i<n;i++) {
30 printf("%d ",fibbonacci(i));
31 }
32}