Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public class sommaRic{
  2.  
  3.  
  4.  
  5. public static int somma(int m, int n){
  6. if(n==0){
  7. System.out.println("Base");
  8. return m;
  9.  
  10. }else {
  11. System.out.println("Else");
  12. return somma (m=m+1, n=n-1);
  13.  
  14.  
  15. }
  16.  
  17. }
  18. public static void main (String[] args){
  19. int m = 3;
  20. int n = 2;
  21. int i = 0;
  22.  
  23. s = somma(m, n);
  24.  
  25. System.out.println (m);
  26. System.out.println(n);
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement