C Program to generate Fibonacci series using an Array

Program to generate Fibonacci series using an array 

Fibonacci series is a series of numbers in which each number of the Fibonacci series is derived by the sum of its two immediate preceding numbers. For example: 0, 1, 1, 2, 3, 5, 8, . . .  The below given C Program to generate Fibonacci series using an Array. Kindly check out the program to generate Fibonacci series using an Array.


Program to Fibonacci series using Array


#include<stdio.h>
    int main(){
    int n,k;
    long int aray[20];

    printf("Enter the number range:\n");
    scanf("%d",&n);
    aray[0]=-1;
    aray[1]=1;
    printf("\n FIBONACCI SERIES: \n");
    for(k=2;k<=n+1;k++){
    aray[k]=aray[k-1]+aray[k-2];
    printf(" %ld",aray[k]);
    }
  return 0;
  }



Sample Output:

Enter the number range:6

FIBONACCI SERIES:

0 1 1 2 3 5

 


Other Related C Programs :


* C Program to find whether the given number is Odd or Even

* C Program to find the Sum of Odd Digits

* C Program to find the Sum of Even Digits

* C Program to find the Sum of Even and Odd Digits,

* C Program to Display Odd digits

* C Program to Display even digits

* C Program to Display Odd Numbers,

* C Program to Display Even Numbers,

* C Program to Check whether the given number is Armstrong number

* C Program to display the Armstrong numbers in Range

* C Program to display the Armstrong numbers between 1 and 1000

* C Program to check perfect number, perfect numbers in range

* C Program to Check Prime number, Prime numbers between 1 and 100

* C Program to display the Prime numbers in a Range

* C Program to display the Sum of Prime numbers

* C Program to Check Strong number

* C Program to display the Strong number in Range

* C Program to Check whether the given number is polindrome number or not

* C Program to Check polindrome number using for loop

* C Program to Check polindrome number using Recursion

* C Program to  check whether the given string is polindrome or not

* C Program to find the Roots of Quadratic equation

* C Program to display Fibonacci Series

* C Program to display the Fibonacci Series using an array

* C Program to display the Fibonacci Series using while loop

* C Program to find the Sum of Fibonacci Series, Factorial of Number

* C Program to find the Factorial without using Recursion

* C Program to find the Factorial using Pointers

* C Program to find the Factorial using Function

Bookmark and Share