Recursion

I need help with my hw. I need help with the recursion part of the code.
Here's the instructions:
First, the program needs to ask the user for a Natural number greater than 1, input the number, and validate that a number was input and that the number is in an acceptable range (Integer > 1). The program should then call the void function primefactor( ). This function should take in only one parameter of type long. Using recursion, this function will print out:

Here's what it should look like:
Please enter a Whole number greater than 1: 5
5 = (5) :Prime!
Continue?(Y/N) Y

Please enter a Whole number greater than 1: 28
28 = (2)(2)(7)
Continue?(Y/N) N
I'm going to write your program in *conceptual parts*

it should look like this

do{

ask for a number
validate that number
call primefactor
print results
} while(toupper(ans == 'Y'));

ans is a char variable, toupper is a function for char's that converts a to A and so forth
Topic archived. No new replies allowed.