Question: in c++ program isprime.cpp a. Write a function read range) which reads in the minimum and maximum values. The function has two parameters listed in
a. Write a function read range) which reads in the minimum and maximum values. The function has two parameters listed in the following order: i. the minimum value of the range; ii. the maximum value of the range. Both parameters should have integer type. Both parameters should be passed by reference. The function does not return any value, but it modifies the two parameters. The function prompts for the minimum and maximum vales. If the minimum or maximum values are less than 2, then the program prints an error message and prompts again for the two values. If the minimum value is greater than the maximum value, then the program prints an error message and prompts again for the two values. The program prints error messages and prompts for the minimum and maximum values until it gets two values greater than or equal to 2 and such that the minimum is less than or equal to the maximum. b. Write a function is prime() which determines if a number is prime. The function has one integer parameter. The function returns true if the input parameter is prime and false otherwise. A number a is prime if and only if (a mod b # 0) for b-2, 3, (a-1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
