Deret Fibonacci
Program Deret Fibonacci dengan Dev C++#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int a, b, x, y, i;
cout<<"Program Deret Fibonacci"<<endl<<endl;
cout<<"Masukkan bilangan : ";cin>>a;
x=1;y=1;
cout<<x<<endl<<y<<endl;
for(int b=3; b<=a; b++)
{
i = x + y;
x = y;
y = i;
cout<<i<<endl;
}
return 0;
}
Program Deret Fibonacci Dengan Pascal
Langganan:
Posting Komentar
(
Atom
)
Tidak ada komentar :
Posting Komentar