@@ -0,0 +1,1116 @@
+package java_problems.beginner;%0D%0A%0D%0Aimport java.math.BigInteger;%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * All submissions for this problem are available.%0D%0A * %0D%0A * You are asked to calculate factorials of some small positive integers.%0D%0A * Input%0D%0A * %0D%0A * An integer t, 1 %3C= t %3C= 100, denoting the number of testcases, followed by t%0D%0A * lines, each containing a single integer n, 1 %3C =n %3C= 100.%0D%0A * Output%0D%0A * %0D%0A * For each integer n given at input, display a line with the value of n!%0D%0A * Example%0D%0A * %0D%0A * Sample input:%0D%0A * 4%0D%0A * 1%0D%0A * 2%0D%0A * 5%0D%0A * 3%0D%0A * %0D%0A * Sample output:%0D%0A * 1%0D%0A * 2%0D%0A * 120%0D%0A * 6%0D%0A */%0D%0Apublic class SmallFactorials %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09Scanner sc = new Scanner(System.in);%0D%0A%09%09int numCases = Integer.parseInt(sc.nextLine());%0D%0A%09%09for (int i = 0; i %3C numCases; i++) %7B%0D%0A%09%09%09System.out.println(factorial(Integer.parseInt(sc.nextLine())));%0D%0A%09%09%7D%0D%0A%09%09sc.close();%0D%0A%09%7D%0D%0A%09%0D%0A%09private static String factorial(int num) %7B%0D%0A%09%09BigInteger fact = new BigInteger(%221%22);%0D%0A%09%09%0D%0A%09%09for (int i = 1; i %3C= num; i++) %7B%0D%0A%09%09%09fact = fact.multiply(new BigInteger(i + %22%22));%0D%0A%09%09%7D%0D%0A%09%09return fact.toString();%0D%0A%09%7D%0D%0A%7D

Add SmallFactorials