Created
May 17, 2012 21:56
-
-
Save godie007/2721826 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Ejercicio5 { | |
public static void main( String args[] ){ | |
int cuantos = 5; | |
int primero = 1; | |
int segundo = 3; | |
System.out.println(metodo(cuantos, primero, segundo)); | |
} | |
public static int metodo(int cuantos,int primero,int segundo) { | |
for(int i = 0; i < cuantos; i++){ | |
System.out.println(primero); | |
int tercero = primero + segundo; | |
primero = segundo; | |
segundo = tercero; | |
}return primero; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment