Computer Science, asked by yakshit32, 4 months ago

Write a C program to print a Fibonacci Series using Recursive function. ​

Answers

Answered by pranav20071011
0

Answer:

#include<stdio.h>

void printFibonacci(int n){

static int n1=0,n2=1,n3;

if(n>0){

n3 = n1 + n2;

n1 = n2;

n2 = n3;

printf("%d ",n3);

Explanation:

Answered by samarthkrv
0

Answer:

#include<stdio.h>

#include<conio.h>

void fib(int range)

{

int a = 0 , b = 1 , c;

printf("%d %d" , a , b);

for(int i = 2; i < range; i++)

{

c = a + b;

printf(" %d" , c);

a = b;

b = c;

}

}

int main()

{

printf("Enter the number of numbers in the fibonacci series:");

int ran;

scanf("%d" , &ran);

fib(ran);

getch();

}

Explanation:

Similar questions