Berikut Program Deret Fibonacci Function
#include<stdio.h>
#include<stdlib.h>
int fibonacci(int a, int b,int c);
int main()
{
int result2=0;
int x,y,z;
scanf("%d",&p);
result2=fibonacci(x,y,z);
system("pause");
}
int fibonacci(int a, int b,int c)
{
int result=0;
int count=1;
a=0;
b=1;
printf(" %d ",b);
for(count=1;count<=c-1;count++)
{
result=x+y;
printf(" %d ",result);
a=b;
b=result;
}
return result;
}
program ini dibuat dengan Borland Turbo++semoga dapat membantu ^_^
Post a Comment