my code does not work its suppose to print out for the nth interger given by the user
for example if the user inputs 4 the code is suppose to print out 1,2,1,5,1.66
public static int fib(int n){
int a =1;
int b =1;
int c =a+b;
for(int i=0; i<=n; i++){
int d = a+b;
a=b;
b=d;
}
return b;
}
public static void main(String[]args){
String input = JOptionPane.showInputDialog("Enter n: ");
int n = Integer.parseInt(input);
int d= fib(n+1)/fib(n)
for(int i=2; i<=n; i++){
System.out.println((double)d);
}
}