Facebook Page // Twitter Page
3 Comments
Leave a comment
Profile pictures are tied to your email address and can
be set up at Gravatar.
Click here for recent comments.
(Note: You must have javascript enabled to leave comments, otherwise you will get a comment submission error.)
(Note: You must have javascript enabled to leave comments, otherwise you will get a comment submission error.)




I once wrote out the Fibonacci sequence to the 98th number.
I was bored...
He need a pair of rabbits to pass the time.
//yeh on that same topic.../
import java.io.*;
class Fibonacci {
public static void main(String[] args) throws IOException {
PrintWriter wF = new PrintWriter(new BufferedWriter(new FileWriter("Fibonacci.txt")));
long[] Fibonacci = new long [94];
int c=0;
wF.println("The Fibonacci Sequence on its first 100 places:");
Fibonacci[0]=0;Fibonacci[1]=1;
System.out.println("Fibonacci[0] = 0");
wF.println("Fibonacci[0] = 0");
System.out.println("Fibonacci[1] = 1");
wF.println("Fibonacci[1] = 1");
for(c=2;c Fibonacci[c]=Fibonacci[c-1]+Fibonacci[c-2];
System.out.println("Fibonacci["+c+"] = "+Fibonacci[c]+" which is: "+Fibonacci[c-1]+" + "+Fibonacci[c-2]);
wF.println("Fibonacci["+c+"] = "+Fibonacci[c]+" which is: "+Fibonacci[c-1]+" + "+Fibonacci[c-2]);
}
wF.close();
}
}//am i a nerd?/