Skip to content

Instantly share code, notes, and snippets.

@godie007
Created May 17, 2012 21:56
Show Gist options
  • Save godie007/2721826 to your computer and use it in GitHub Desktop.
Save godie007/2721826 to your computer and use it in GitHub Desktop.
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