Question: Next to the above lines, write a functional C + + code to create a recursion function that can determine if a given number is

Next to the above lines, write a functional C++ code to create a recursion function that can determine if a given number
is a prime number. You must use recursion, or you will receive 0 credit. [Hint: Try recursively divide the given number by
all integers (starting at 2, not 1). If this number has more than two integral factors, then it is not a prime number.]
3. Add another function that asks the user to enter an integer which will serve as the boundary (e.g.,100). Then
display all the prime number that is less than or equal to the boundary.
4. A sample output looks:
Enter a positive integer: 170
Prime numbers no larger than 170:
2357111317192329313741434753596167717379838997101103107
109113127131137139149151157163167

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 Programming Questions!