Nih Rumusnya!
Ahirnya dengan bantuan om senior, kurang lebih hasilnya jika menggunakan bahasa C++ :
Preview
Setelah dimasukan Input dan Outputnya
Buat agan-agan yang mau coba!
Nih scriptnya, silahkan dicopy paste.
#include <stdio.h>
#include <conio.h>
int main(void)
{
int x,a=1,b=1,hasil;
printf("==================================\n");
printf(" >>>> dr15.no.tc <<<< \n");
printf("==================================\n\n");
printf("Masukkan n = "); scanf("%d",&x);
printf(" %d %d ",a,b);
for(int i=2;i<x;i++)
{
hasil=a+b;
a=b;
b=hasil;
printf(" %d ",hasil);
}
printf("\n\n");
printf("==================================\n");
printf(" Copyright 2012 || Mr. DR \n");
printf("==================================\n");
getch();
}
Danke !
No comments:
Post a Comment