C Programming Code Examples C > Mathematics Code Examples Fibonacci Series Program In C Fibonacci Series Program In C Fibonacci Series generates subsequent number by adding two previous numbers. Fibonacci series starts from two numbers - F0 & F1. The initial values of F0 & F1 can be taken 0, 1 or 1, 1 respectively. Fibonacci series satisfies the following conditions #include <stdio.h> int main() { int a, b, c, j, n; n = 8; a = b = 1; printf("%d %d ",a,b); for(j = 1; j <= n-2; j++) { c = a + b; printf("%d ", c); a = b; b = c; } return 0; } procedure fibonacci : fib_num IF fib_num less than 1 DISPLAY 0 IF fib_num equals to 1 DISPLAY 1 IF fib_num equals to 2 DISPLAY 1, 1 IF fib_num greater than 2 Pre = 1, Post = 1, DISPLAY Pre, Post FOR 0 to fib_num-2 Fib = Pre + Post DISPLAY Fib Pre = Post Post = Fib END FOR END IF end procedure