This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Tampilkan postingan dengan label program fibonaci. Tampilkan semua postingan
Tampilkan postingan dengan label program fibonaci. Tampilkan semua postingan

Senin, 05 Maret 2012

program fibonaci

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

using namespace std;
    int fibonacci(int x)
       {
     
       if(x==1)
           return(0);
       else if(x==2)
           return(1);
       else
           return (fibonacci(x-1)+fibonacci(x-2));
        }

    int main()
        {
       int x;
       cout<<"\nMasukan Jumlah Bilangan Fibonacci Yang Ingin Anda Tampilkan: ";cin>>x;
       for(int y=1;y<=x;y++)
           cout<<fibonacci(y)<<" ";
           cout<<endl;
          
    system("pause");
    return(0);
}

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More