Question: I have this C++ task: In the finished program code base, implement a program that divides the given input into two factors that are as
I have this C++ task:
In the finished program code base, implement a program that divides the given input into two factors that are as close as possible to each other.
At first, the program asks for a positive number (input). If zero or a negative number is given as input, the program prints "Only positive numbers accepted". Otherwise, the program prints the product and its two factors. The smaller of the factors is printed first.
Below are a few examples of how the program works. Notice how 5 is 1*5 but for example 16 is 4*4, not 1*16 or 2*8. It is crucial that the two factors are as close to each other numerically as they can be. This is the third time I am asking this question as I have only gotten wrong answers where the input is not as the examples show below.

Thank you so much in ahead!
Enter a positive number: 20 20=45 Enter a positive number: 16 16=44 Enter a positive number: 5 5=15 Enter a positive number: 60 60=610 Enter a positive number: 0 Only positive numbers accepted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
