Please enable javascript to view this site.
Coretan-indpras
Facebook
Twitter
Google+
RSS
Home
Admin
About Admin
Accesories
Tukar Link
Barner sobat
Select Menu
Loading...
Home
»
Catatan Kuliahku
»
Java
»
Bilangan Fibonacci di java
Bilangan Fibonacci di java
Diposting oleh
Unknown
Label:
Java
di
13:55
bilangan fibonacci di java
Sobat indpras langsung saja berikut codingnya
package bil_fibonacci; /** * * @author indpras */ import java.util.Scanner; public class bil_fibonacci { void Show() { Scanner input=new Scanner(System.in); int fn, awal, fn2, akhir; awal=1; fn2=1; System.out.print("Maukkan nilai awal : "); awal=input.nextInt(); System.out.print("Maukkan nilai akhir : "); akhir=input.nextInt(); fn=awal+fn2; while (awal <= akhir) { System.out.print(" "+fn); fn2=awal; awal=fn; fn=awal+fn2; } System.out.print(" "); } public static void main(String[] args) { bil_fibonacci bil= new bil_fibonacci(); bil.Show(); // TODO code application logic here } }
outputnya
Demikian semoga bermanfaat
Posting Komentar
Ayo berikan Komentarmu, karena satu komentar dari kamu itu sangat berarti bagi saya (^_^)
« Sebelumnya
Berikutnya »
Copyright © 2013
All Right Reserved
Designed by
Indra Prasetya
Powered by
Blogger
Back to Top