Write a program that read a number & test Fibonacci or not Fibonacci.

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int n,i;
    clrscr();
    cout<<"Enter how many numbers, n = ";
    cin>>n;

    long a=0;
    long b=1;
    long c;
    for(i=1;a<n;i++)
    {
       c=a+b;
       a=b;
       b=c;
    }

    if(a==n)
       cout<<"Fibonacci";
    else
       cout<<"Not Fibonacci";
    getch();

}

///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........