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

Select
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?
Valeo Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits