IJUL'S BLOG

Contoh Fungsi Fibonacci

catatan kuliahq:
 ni source code nya bro:

#include <iostream.h>
#include <conio.h>
int n;
void fibonaci();
void main()
{

    cout << "Jumlah deret fibonacci = ";
    cin >>n;
    fibonaci();
}
void fibonaci()
{
    float a,b,c;
    int i;
    a=1;
    b=1;
    cout <<"\n"<< a <<"\n"<< b ;
    for (i=3;i<=n;i++)
    {
        c=a+b;
        a=b;
        b=c;
        cout <<"\n"<< c ;
    }


    getch();
}

0 komentar:

Posting Komentar

Powered By Blogger
Diberdayakan oleh Blogger.

Entri Populer

PENGUNJUNG

Buku Tamu

About Me

Foto Saya
Ijal Ferdi
there is no something special about me,,, but this blog is so special for me......
View my complete profile

Total Tayangan Halaman

Followers