IP - Program to generate Fibonacci Series

Write a program to generate a Fibonacci series up to a given number using Net beans (Java)?

Introduction to Fibonacci Series 

Lets try to understand What is Fibonacci Series? 



It is a series of numbers that follows some pattern generated by adding previous two numbers, where first two numbers are 0 and 1. 

Fibonacci series has quite a lot contribution to our life. Browse the internet and you will be able to find lot many, just by googling it. I have also summarized these useful links a single page - Click here to get more information about Fibonacci series. 

Fibonacci Series using Net beans (Java)
Fibonacci Series using Java (Net beans)


 private void FibogenActionPerformed(java.awt.event.ActionEvent evt) {                                     
        int N=Integer.parseInt(TF_UL.getText());
        int a=0,b=1,c=a+b;
        TA_FS.append(a+", " + b + ", ");
        while(c<=N)
        {
            TA_FS.append(c+", ");
            a=b;
            b=c;
            c=a+b;
     
        }
    }

Note: To understand better, you need to know:
1. Button name labelled "Generate" is Fibogen
2. Textfield for accepting upper limit is TF_UL
3. Text Area is used for Fibonacci series, its name is TA_FS

More useful links:



Popular posts from this blog

IP- Program to find a given number is Perfect Number or not?

Java and Java using Netbeans - What is the Difference?