Starting from:
$35

$29

Project 2 - Prime Divisor Calculator Solved

This repository contains the source code for a simple program [proj2.c](proj2.c), which calculates the number between 1 and a user-provided upper bound `N`, that has the most number of prime divisors. In case several integers in this range have the same maximum number of divisors, the program outputs the smallest one.

   Problem Statement

Write a program, which reads a value `N` for an upper bound from the user and finds the number between 1 and `N`, which has the largest number of prime number divisors. In addition, the program should print the number and the number of prime divisors that this number has.

Note that, several integers in this interval can have the same, maximum number of divisors. In this case, your program has to print out the smallest one.

   Examples

For the input value of `N`:

- 9, the output is `6 2`
- 32, the output is `30 3`
- 220, the output is `210 4`

More products