Why Nostr? What is Njump?
2023-02-07 16:54:44
in reply to

dave on Nostr: public class RecursionExample { public static void main(String[] args) { ...

public class RecursionExample {

public static void main(String[] args) {
System.out.println("Factorial of 4 is: "+factorial(4));
}

static int factorial(int n) {
// Base case
if (n == 0)
return 1;

// Recursive case
else
return(n * factorial(n-1));
}

}
Author Public Key
npub1tsgw6pncspg4d5u778hk63s3pls70evs4czfsmx0fzap9xwt203qtkhtk4