VR Indian Wanderers Youtube RSS Feed
Learn with Vikas Suhag
Program to implement Fibonacci series using C Language
Jan 04, 2022   Vikas Suhag

Fibonacci series using C Language

Program to implement Fibonacci series using C Language

Fibonacci series involves addition of last two numbers to generate next number. It can be achieved using one dimensional array and loops.

#include <stdio.h>
int main()
{
int i, fibonacci[20]; // declaration of array (0-19)
fibonacci[0] = 0; // initialization of array // value assign
fibonacci[1] = 1; // initialization of array // value assign
for( i = 2; i < 20; i++ ) //4
    fibonacci[i] = fibonacci[i - 2] + fibonacci[i - 1];
for( i = 0; i < 20; i++ )
    printf( "Fibonacci[%d] = %d\n", i, fibonacci[i]);
}


Leave a Comment

* Email will not be published.
All comments are only visible after approval.
Most Viewed articles
Travel Blog - VR Indian Wanderers
VR Indian Wanderers
Govt. Jobs Portal
Govt. Jobs Portal
Free Chart Maker
Make free animated Charts from .CSV
Search
Youtube Channel
Podcast
Subscribe to Email Updates
Connect With Us
VR Indian Wanderers Youtube RSS Feed
© 2024 Learn with Vikas Suhag. All Rights Reserved.