Finding number of integers which has exactly X divisors
Java program to find Number of integers which has exactly x divisors:
Our Aim is to find the Number of integers which has exactly X divisors using Java programming language.
In This program the user gives a range and the number of divisors(say N), and divisors of every number in between the range are counted and compared with N.
At last the total number of integers are counted which have N number of divisors.
- Iterate all numbers till n
- Count the numbers that have exactly 9 divisors
- Iterate till n
- Check if n is divisible by i
- Increase value of count
- Print count
Code In Java:
Enter the number of your choice :
The number which has exactly 9 divisors
Total number of divisors =2