Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

#include <stdio.

h>

int fibo(int n);

int main()
{
int n;
printf("enter till what number you want fibonacci\n");
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
printf("%d\t",fibo(i));
}
}

int fibo(int val)


{
if(val==1||val==0)
return 1;
else
return fibo(val-1)+fibo(val-2);
}

You might also like