Advertisement
joseleonweb

Untitled

Feb 2nd, 2021
825
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. public static void main(String[] args) {
  2.         recurseMethod(4);
  3.         factorial(5);
  4.     }//end method main
  5.    
  6. public static double factorial(double d) {
  7.     //Sort elements by title case.
  8.     if (d <= 1) {
  9.         return 1;
  10.     }
  11.     else {
  12.         return d * factorial(d - 1);
  13.     }//endif
  14. }//end method factorial
  15.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement