Download this Blogger Template by Clicking Here!

Friday, August 30, 2013

Widgets

CONTOH PROGRAM MENGHITUNG DERET BILANGAN FINOBACHI

#include <stdio.h>
main(){
       int nilai,i;
       printf("Masukkan jumlah deret bilangan fibonacci : ");
       scanf("%d",&nilai);       
       for(i=1;i<=nilai;i++){
         printf("%d ",fibo(i));
       }
       return 0;
}
 
int fibo(int a){    
    if(a==0) return 0;
    if (a == 1) return 1;
    else return fibo(a-2) + fibo(a-1); 
}

SHARE THIS POST   

  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati
Author: Mohammad
Mohammad is the founder of STC Network which offers Web Services and Online Business Solutions to clients around the globe. Read More →

0 comments: