Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ryan west
- D Block
- P6.2
- package prime;
- import java.util.Scanner;
- public class Fibinoco {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int fold2;
- int foldnew;
- int fold1 = 1;
- System.out.println("How many times will it multiply");
- int num= s.nextInt();
- for(int f = 1; f <= num; f++)
- {
- fold2 = fold1;
- foldnew = fold1 +fold2;
- fold1 = foldnew;
- System.out.println(fold1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement