Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

PROGRAM TO EVALUATE FIBONACCI SERIES AND CHECKING WHETHER OR NOT IT IS FIBINICCI NO

Posted By: Evan Evans     Category: C Programming     Views: 5853

PROGRAM TO EVALUATE FIBONACCI SERIES AND CHECKING WHETHER OR NOT IT IS FIBINICCI NO.

Code for PROGRAM TO EVALUATE FIBONACCI SERIES AND CHECKING WHETHER OR NOT IT IS FIBINICCI NO in C Programming

#include<stdio.h>
#include<conio.h>
void main()
{
    longint a=0,b=1,i,sum,n,j=0,m;
    clrscr();
    printf(" Please Enter value for N: ");
    scanf("%ld",&n);
    printf("\n PLEASE ENTER THE CHECKING NO.: ");
    scanf("%ld",&m);
    printf("\n\n\t\t\t IT IS FEBONACCI SERIES \n  ");
    printf("%ld ,",a);
    printf("%ld ,",b);
    for(i=2;i<n;i++)
    {
        sum = a+b;
        a = b;
        b = sum;
        if(sum==m)
            j=1;
        printf("%ld ,",sum);
    }
    if(j==1)
        printf("\n\n\t\t\t %ld IT IS FEBONNACI NUMBER. ",m);
    else
        printf("\n\n\t\t\t %ld IT IS NOT FEBONNACI NUMBER. ",m);
    getch();
 }





**************************************OUTPUT***********************************

 Please Enter valuefor N: 9

 PLEASE ENTER THE CHECKING NO.: 21


                         IT IS FEBONACCI SERIES



0 ,1 ,1 ,2 ,3 ,5 ,8 ,13 ,21 ,

                         21 IT IS FEBONNACI NUMBER.
  
Share: 



Evan Evans
Evan Evans author of PROGRAM TO EVALUATE FIBONACCI SERIES AND CHECKING WHETHER OR NOT IT IS FIBINICCI NO is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!