diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 492410c8..edf8b765 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2125,3 +2125,9 @@ Place: India
About: Computer science student
Programming languages: c , cpp, python , ruby , js
Email: rupnamaitra100@gmail.com + +Name: [Davi Batista](https://github.com/Davi-s-Brain) +Place: São Paulo +About: IT student +Programming Language: C, JS, TS, Python, SQL. +Email: batista-davi@outlook.com \ No newline at end of file diff --git a/factorial/recursive_factorial.c b/factorial/recursive_factorial.c new file mode 100644 index 00000000..c36913d8 --- /dev/null +++ b/factorial/recursive_factorial.c @@ -0,0 +1,15 @@ +#include + +long factorial(long n) { + if (n == 0) return 1; + return n * factorial(n - 1); +} + +int main() { + long num = 0; + scanf("%li", &num); + + printf("%li\n", factorial(num)); + + return 0; +} \ No newline at end of file