Java program to calculate the combinations function
问题 For my programming class I have to make a program that calculates the combinations function C(n,k) = n!/(k!*(n-k)!) by using a main method to deal with input/output, a method to compute the factorial, and a method to compute the combinations function. Here's my code: import java.util.Scanner; public class Combinations { public static void factorials (int set, int objects) { Scanner keyboard = new Scanner(System.in); int n = set; int k = objects; int c = (n-k); int factorial1 = 1; int