Write a program to print Fibonacci series using recursion

AnswerBot
1y
A program to print Fibonacci series using recursion.
Define a recursive function that takes an integer n as input
Base case: if n is 0 or 1, return n
Recursive case: return the sum of the previous two Fi...read more
swaranjali yamgar
2y
#include<stdio.h>
int Fibonacci(int);
int main()
{
int n, i = 0, c;
scanf("%d",&n);
printf("Fibonacci series\n");
for ( c = 1 ; c <= n ; c++ )
{
printf("%d\n", Fibonacci(i));
i++;
}
return 0;
}
int...read more
Tarek Allam
2y
#include <stdio.h>
#include "stdio.h"
int fib (int x);
int main ()
{
int x;
scanf("%d",&x);
for (int i =0; i <x;i++)
{
printf ("%d",i);
}
return 0 ;
}
int fib (int x)
{
if (x ==...read more
Add answer anonymously...
Popular interview questions of Software Engineer
A Software Engineer was asked Q1. What are the differences between C and Embedded C?
A Software Engineer was asked Q2. Write a program to print Fibonacci series using recursion
A Software Engineer was asked Q3. How can dangling pointers be avoided?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

