Skip to content

not open #345

@jangdechand994-collab

Description

@jangdechand994-collab

#include<stdio.h>

int fib(int n);

int main() {
int result = fib(6);
printf("Fibonacci of 6 is: %d\n", result);
return 0;
}

int fib(int n) {
if (n == 0) {
return 0;
}
if (n == 1) {
return 1;
}

int fibNm1 = fib(n - 1);
int fibNm2 = fib(n - 2);
int fibN = fibNm1 + fibNm2;

return fibN;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions