Question: (C program) Count Positive Integers with a Given Number of Divisors (C program) Program description: Write a program (divisors.c) which reads in an integer k,

(C program) Count Positive Integers with a Given Number of Divisors" (C program)

Program description:

Write a program (divisors.c) which reads in an integer k, and prints out the number of positive integers between 1 and 100000 (inclusive) which have exactly k divisors. As an example, the number 24 has 8 divisors: 1, 2, 3, 4, 6, 8, 12, and 24.

Note that for any positive integer n, the number 1 will always be a divisor of n, and so will n itself.

The program execution should look like the following (user input in bold text):

Enter the target number of divisors: 16

There are 10728 numbers between 1 and 100000 inclusive which have exactly 16 divisors.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!