Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class fib {
- public static void main(String[] args)
- {
- int num1 = 0;
- int num2 = 1;
- System.out.print(num1 + "," + num2 + ",");
- for(int i = 0; i < 100; i++) //change the 100 to whatever amount of numbers you want to print
- {
- System.out.print(num1+num2 + ",");
- int temp = num1;
- num1 = num2;
- num2 = temp+num2;
- }
- }
- }
- PR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement