Advertisement
rockoverlord23

Untitled

Oct 24th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. ryan west
  2. D Block
  3. P6.2
  4. package prime;
  5. import java.util.Scanner;
  6. public class Fibinoco {
  7.  
  8. public static void main(String[] args)
  9. {
  10. Scanner s = new Scanner(System.in);
  11.  
  12. int fold2;
  13. int foldnew;
  14. int fold1 = 1;
  15.  
  16. System.out.println("How many times will it multiply");
  17. int num= s.nextInt();
  18. for(int f = 1; f <= num; f++)
  19. {
  20. fold2 = fold1;
  21. foldnew = fold1 +fold2;
  22. fold1 = foldnew;
  23. System.out.println(fold1);
  24. }
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement