A blog to help students to learn programming in various languages including C, C++, Java, Python and many more.

Subscribe For Free Latest Updates!

We'll not spam mate! We promise.

Showing posts with label Fibonacci. Show all posts
Showing posts with label Fibonacci. Show all posts

Sunday, 10 July 2016


 In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence:

01, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.....

The Fibonacci spiral: an approximation of the golden spiral created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling; this one uses squares of sizes 1, 1, 2, 3, 5, 8, 13, 21, and 34.
By definition, the first two numbers in the Fibonacci sequence are either 1 and 1, or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two. 
Information source: wikipedia.org


Program:->

Program Output
Output

def fibo( x ):
    f = -1; s = 1
    for i in range(0,x):
        n = f + s
        f = s
        s = n
        print n
    return;
n = input ("Enter the total elements in the series: ")
print "The Fibonacci series is: "
fibo(n)
Read More >>

Saturday, 9 July 2016


  In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence:

01, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.....

The Fibonacci spiral: an approximation of the golden spiral created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling; this one uses squares of sizes 1, 1, 2, 3, 5, 8, 13, 21, and 34.
By definition, the first two numbers in the Fibonacci sequence are either 1 and 1, or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two. 
Information source: wikipedia.org


Program:->
Program Output
Output


import java.util.Scanner;
public class seFibo {
    public static int fibo(int x) {
        int f = -1, s = 1, n;
        for (int i = 0; i < x; ++i) {
            n = f + s;
            f = s;
            s = n;
            System.out.println( n );
        }
        return (0);
    }
    public static void main(String[] args) {
        int n, i;
        Scanner sc = new Scanner (System.in);
        System.out.print("Enter the total elements in the series: ");
        n = sc.nextInt();
        System.out.println("The Fibonacci series is: ");
        fibo(n);
    }
}

Note: The program must be saved with name "SeFibo.java". 
Read More >>

Saturday, 19 March 2016


         In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence:

01, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.....

The Fibonacci spiral: an approximation of the golden spiral created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling; this one uses squares of sizes 1, 1, 2, 3, 5, 8, 13, 21, and 34.
By definition, the first two numbers in the Fibonacci sequence are either 1 and 1, or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two. 
Information source: wikipedia.org


Program:->

Program Output
Output

#include <stdio.h>
#include <conio.h>
int fibo(int);
int main() {
int n;
printf("Enter the total elements in the series: ");
scanf("%d", &n);
printf("The Fibonacci series is: \n");
fibo(n);
return(0);
}
int fibo(int x) {
int f=-1,s=1,n, i;
for (i = 0; i < x; i++) {
n=f+s;
f=s;
s=n;
printf("%d\n", n);
}
return(0);
}
Read More >>

Sunday, 24 January 2016


        In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence:

01, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.....

The Fibonacci spiral: an approximation of the golden spiral created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling; this one uses squares of sizes 1, 1, 2, 3, 5, 8, 13, 21, and 34.
By definition, the first two numbers in the Fibonacci sequence are either 1 and 1, or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two. 
Information source: wikipedia.org


Program:->
Program Screenshot
Output

#include <iostream>
using namespace std;
int fibo(int);
int main() {
int n,i;
cout<<"Enter the total elements in the series: ";
cin>>n;
cout<<"The Fibonacci series is: \n";
fibo(n);
return(0);
}
int fibo(int x) {
int f=-1,s=1,n;
for (int i = 0; i < x; ++i) {
n=f+s;
f=s;
s=n;
cout<<n<<"\n";
}
return(0);
}
Read More >>


Copyright © 2016 - ProgrmIt - All Rights Reserved
(Articles Cannot Be Reproduced Without Author Permission.)
Design By : | Powered By: Blogger