Fibonacci sequence

package rjms; /** * * @author Ronald */ public class Rjms { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int x = 1; int y = 0; int z; while(true){ z = x; x = x + y; y = z; System.out.println(x); if(x > 1000){ System.out.println("Fin del programa"); break; } } } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.