Fibonacci in Java
Today I'm sharing a project of my creation.
I hope you enjoy
Crsdits:
@6ixth
I hope you enjoy

Code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pkg5.pkg11.pkg3;
import java****.BufferedReader;
import java****.InputStreamReader;
import java****.Console;
import java********Exception;
public class Principal {
private static int seg;
/**
Programa desenvlvido por wallyson Marcos
* 06/04/2013
*/
public static void main(String[] args) throws IOException {
BufferedReader entrada;
entrada = new BufferedReader(new InputStreamReader(System.in));
long Fn=0;
long Fn1=1;
long b=1;
long ent;
long cont = 0;
int opc ;
try{
System.out.println("||=========================Menu of project===============================||");
System.out.println("||Enter 1 to determine how far will the nth Fibonacci number. ||");
System.out.println("||Enter 2 to determine the count of the number nth. ||");
System.out.println("||==================================================================||");
opc = Integer.parseInt(entrada.readLine());
switch(opc)
{
case 1:{
System.out.println("Enter a number to determine how far will the nth Fibonacci number");
ent = Integer.parseInt(entrada.readLine());
System.out.println("Its sequel: ");
for(int i=2;i<=1000;i++){
System.out.println(Fn+";");
b=Fn;
Fn=Fn+Fn1;
Fn1=b;
if(Fn>ent){break;
}
}
break;
}
case 2:{
System.out.println("Enter a number to determine the count of the number nth. : ");
ent = Integer.parseInt(entrada.readLine());
System.out.println("Its sequel: ");
for(int i=1;i<=ent;i++){
System.out.println(Fn+";"+" Contador: "+i);
b=Fn;
Fn=Fn+Fn1;
Fn1=b;
}
}
break;
default:
System.out.println("Enter the correct option!");
}
} catch (Exception e){
System.out.println("Enter a correct value!");
}
}
}
@6ixth
