fibonacci

How to create Fibonacci Sequence Up to a Certain Number in C Program Language

Spread the love

Today we have learned how to create a C program look up and understand all this logic up to a certain number of Fibonacci sequences. This logic is easy. Copy the code I have given below and paste it into your turbo c software or code block software and this Run the program and you will get your result

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a=0,b=1,c,i,n ;
    printf("enter your number :-") ;
    scanf("%d",&n) ;

printf("\n\n") ;
      printf("your fibonacci series number :-\n\n") ;
    for(i=0;i<n;i++)
    {
        c=a+b ;
        printf(" %d ",c) ;
        a=b ;
        b=c ;
    }
}

Output:-

Enter number and click Enter Button
Fibonacci Number Output

Leave a Reply

Your email address will not be published. Required fields are marked *