Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. package fibonachi;
  2.  
  3. import org.junit.Test;
  4.  
  5. public class fibo {
  6. @Test
  7. public void test()
  8. {
  9. System.out.println(fibo(1, 1, 40));
  10. }
  11.  
  12. public static int fibo(int getal1, int getal2, int a) {
  13. System.out.println(getal1);
  14. if(a > 0)
  15. {
  16. int getal = getal1 + getal2;
  17. return fibo(getal2, getal, a-1);
  18. }
  19. return getal1;
  20. }
  21. }
  22.  
  23.  
  24. import junit.framework.JUnit4TestAdapter;
  25.  
  26. public class main {
  27. public static junit.framework.Test suite() {
  28. return new JUnit4TestAdapter( fibo.class );
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement