C Programming
- Print integer
- Add & subtract
- Odd & even
- Multiply & divide
- Check vowels
- Letter grade program
- Leap year program
- Sum of digits
- Prime numbers
- Sum of numbers
- Find factorial
- Fibonacci series
- Fibonacci triangle
- Number triangle
- Alphabet triangle
- Armstrong numbers
- Palindrome numbers
- Swap number
- Reverse number
- Decimal to binary
- Assembly code in C
- Matrix multiplication
- HCF & LCM
- nCr & nPr
- Print pattern
- Floyd’s triangle
- Pascal triangle
- Count digits
- Strong numbers
- Perfect numbers
- Sum of natural number
- Binary to decimal
- Decimal to octal
- Octal to decimal
- Binary to octal
- Octal to binary
- Add using pointer
- Bubble sort
- Insertion sort
- Selection sort
- Quick sort
- Binary search
- Linear search
- Largest element of array
- Smallest element of array
- Reverse Array
- Variable size & limit
- ASCII value of character
- Sum of array elements
- Number of element in array
- Merge two array
- Insert element in array
- Delete element from array
- Add two matrix
- Transpose matrix
- Print string
- Reverse string
- Delete vowels
- Sort string
- Remove spaces
- Swap string
- Random numbers
- Print date & time
- Print IP address
- Shut down computer
Fibonacci series in C
Fibonacci series is one kind of series where the next number will be equal to the sum of previous two numbers. First two numbers of a fibonacci series will be 0 and 1. Then the other number will be the result of sum to previous two numbers.

First few numbers of a fibonacci series will be 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ……etc. Look, here first two numbers are 0 and 1. But other numbers are equal to the result of addition of previous two numbers.
We can write a program to print fibonacci series in C in various way. Let’s see some way to print a fibonacci series in C programming.
Fibonacci series program in C without recursion
// fibonacci series program in C
#include <stdio.h>
int main(){
int num, first = 0, second = 1, other, i;
printf("Enter total number in the series : ");
scanf("%d", &num);
printf("\nFirst %d numbers of Fibonacci series are : \n\n", num);
for (i = 0; i < num; i++){
if (i <= 1){
other = i;
}else{
other = first + second;
first = second;
second = other;
}
printf("%d ", other);
}
printf("\n");
return 0;
}
Output of this fibonacci series program:

Fibonacci series program in C with recursion
// fibonacci series program in C with recursion
#include <stdio.h>
int fibo(int num){ // function for fibonacci series
if (num == 0 || num == 1){
return num;
}else{
return (fibo(num - 1) + fibo(num - 2));
}
}
int main(){
int num, i, k = 0;
printf("Enter how many numbers you want in the series : ");
scanf("%d", &num);
printf("Your expected fibonacci series is :\n");
for (i = 1; i <= num; i++){
printf("%d ", fibo(k));
k++;
}
return 0;
}
Output:

Previous page:Â Find factorial program
Next page:Â Fibonacci triangle