13.0k views
3 votes
Write code to complete printfactorial()'s recursive case. Sample output if input is 5:.

User Gangula
by
7.6k points

1 Answer

4 votes

Answer:

public static void printfactorial(int n) {

if (n == 0 || n == 1) {

System.out.print(1);

return;

}

System.out.print(n + " * ");

printfactorial(n-1);

}

User Evading
by
7.2k points