Thursday, 9 August 2018

contoh script java fibonanci


public class fibonanci
{
                                public static void main (String[]args)
                                {
                                                int a=1,b=1;
                                                int n = 5;
                                                System.out.print(a+" ");
                                                for(int i=1; i<n;i++)
                                                {
                                                                System.out.print(a+" ");
                                                                a = a+b;
                                                                b = a-b;
                                                }
                                                System.out.println();
                                }
}


  Download script disini















No comments:

Post a Comment