The solution below will answer following questions :
1. Write a program to generate the Fibonacci series in C.
2. Fibonacci series in C using for loop.
3. How to print Fibonacci series in C.
4. Write a program to print Fibonacci series inC.
5. How to find Fibonacci series in C programming.
6. Basic C programs Fibonacci series.

Fibonacci series in C using for loop

C

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

/**

Fibonacci series in C using for loop by Codebind.com

*/

#include <stdio.h>

#include <stdlib.h>

intmain(){

intr=0,a=0,n,b=1,i,c;

charredo;

do{

a=0;

b=1;

printf("enter the the value of n:");

scanf("%d",&n);

if(n>100){

printf("enter some lessor value\n");

}

else{

for(i=0;i<=n;i++){

c=a+b;

a=b;

b=c;

printf("serial no.%d => ",i+1);

printf("%d\n",a);

}

printf("enter y or Y to continue:");

scanf("%s",&redo);

printf("\n");

}

}

while(redo=='y'||redo=='Y');

return0;

}

/*

OUTPUT

enter the the value of n:10

serial no.1 => 1

serial no.2 => 1

serial no.3 => 2

serial no.4 => 3

serial no.5 => 5

serial no.6 => 8

serial no.7 => 13

serial no.8 => 21

serial no.9 => 34

serial no.10 => 55

serial no.11 => 89

enter y or Y to continue:

*/

Solution 2 –

If we want to Write a program to generate the Fibonacci series in C using recursion, the follow the solution below :

Fibonacci series in C using recursion by codebind.com

C

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

/**

Fibonacci series in C using recursion by codebind.com

*/

#include <stdio.h>

#include <stdlib.h>

intFibonacci(intx){

if(x<2){

returnx;

}

return(Fibonacci(x-1)+Fibonacci(x-2));

}

intmain(void){

intnumber;

printf("Please enter a positive integer: ");

scanf("%d",&number);

if(number<0)

printf("That is not a positive integer.\n");

else

printf("%d Fibonacci is: %d\n",number,Fibonacci(number));

return0;

}

/*

OUTPUT

Please enter a positive integer: 10

10 Fibonacci is: 55

*/

Solution 3 –

The solution below will answer following questions :
1. Fibonacci series using array in C
2. Fibonacci series program in C language
3. Source code of Fibonacci series inC
4.Write a program to print Fibonacci series in C