- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Divisors of factorials of a number in java
Following is a Java program to find the divisors of factorials of a number.
Program
import java.util.Scanner; public class DivisorsOfFactorial { public static long fact(int i) { if(i <= 1) { return 1; } return i * fact(i - 1); } public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter the n value :"); int n = sc.nextInt(); int result = 0; long fact = fact(n); for (int i = 1; i<= fact; i++) { if (fact%i == 0) { result = result+i; } } System.out.println(result); } }
Output
Enter the n value : 4 60
- Related Articles
- Find all divisors of a natural number in java
- Sum of all proper divisors of a natural number in java
- Find sum of divisors of all the divisors of a natural number in C++
- Counting divisors of a number using JavaScript
- Count all perfect divisors of a number in C++
- Minimum number of Square Free Divisors in C++
- Check if a given number divides the sum of the factorials of its digits in C++
- Find all divisors of a natural number - Set 1 in C++
- Find all divisors of a natural number - Set 2 in C++
- First triangular number whose number of divisors exceeds N in C++
- Program to maximize number of nice divisors in Python
- Product of first N factorials in C++
- Check if a number is divisible by all prime divisors of another number in C++
- Java Program for Common Divisors of Two Numbers
- Count the number of common divisors of the given strings in C++

Advertisements