From 3e4961a48bee183d2adbeb88834eeb8d747c5f8e Mon Sep 17 00:00:00 2001 From: Aditya Pratap <75004300+adityapratap123@users.noreply.github.com> Date: Tue, 11 Oct 2022 22:44:47 +0530 Subject: [PATCH] Create fibbonaci series fibbonaci series is a series whose new term is sum of previous two terms. this program is used to find fibbonaci series upto n terms using recurssion --- fibbonaci series | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 fibbonaci series diff --git a/fibbonaci series b/fibbonaci series new file mode 100644 index 0000000..f09b3c5 --- /dev/null +++ b/fibbonaci series @@ -0,0 +1,36 @@ +#include +int fibo(int n); + +int main(){ + +int a,c; +scanf("%d",&a); +if(a==0){ + printf("please enter correct value of n"); +} +else{ +c=fibo(a); +printf("%d",c); +} + + + + + + + + +return 0; +} +int fibo(int n){ +if(n==1){ + return 0; +} +else if(n==2){ + return 1; +} +else{ + return fibo(n-1)+fibo(n-2); +} + +}