here is what i want it to do
1)choose a function and then enter two number for interval boundary.
2)unless user enter two 0, it will keep asking for two "new number" to as the interval and display all number in between with respect power.
3)when user enter 0 and 0 the original option will appear and ask user to choice a new function or quit

here is my problem
1)when i enter q the first time the prompt is up, the program will end
2)however when i enter q after i had go through a function already the program will not end,
3)how do i fix that

here is what i input and the program output
1)
choice a function
i enter q the program ends.
2)
choice a function
i enter s for square
i enter 2 and 4 for boundary
it prints
4 and 8
i enter 0 and 0 for boudary
it ask me to enter another function or quit
i enter q
my out put is a prompt asking me to enter the number for the boundary.

here is what i want it to do
1)choose a function and then enter two number for interval boundary.
2)unless user enter two 0, it will keep asking for two "new number" to as the interval and display all number in between with respect power.
3)when user enter 0 and 0 the original option will appear and ask user to choice a new function or quit

here is my problem
1)when i enter q the first time the prompt is up, the program will end
2)however when i enter q after i had go through a function already the program will not end,

Like I said yesterday, don't use recursion to run the code again when a loop will do. This is what happens:

Code:

if ( (lowVal == 0 && maxVal == 0))
printNum();

So your callstakc is:

Code:

main
printNum
printNum

You exit out of the inner printNum, and then you are in the outer printNum function - you should use a loop construct.

3)how do i fix that

Consider the above and the solution will be relatively easy

here is what i input and the program output
1)
choice a function
i enter q the program ends.
2)
choice a function
i enter s for square
i enter 2 and 4 for boundary
it prints
4 and 8
i enter 0 and 0 for boudary
it ask me to enter another function or quit
i enter q
my out put is a prompt asking me to enter the number for the boundary.

#3. Your use of recursion here, for this particular problem, is ill advised. It gains you nothing and is inappropriate to what you're trying to accomplish. Your problems are because of the recursive calls being made. In particular, pay attention to this:

If you enter 0 0 for the bounds, you recursively call the printNum function which gets you your menu printed asking to choose a function. When you enter 'Q', you for some reason choose to have the user reenter the bounds again when they shouldn't have to (they already said they wanted to quit). The recursive call to printNum then ends after a second use of 0 0 for the bounds which only takes you back to the first call made to printNum whereupon you try to go through the subsequent for-loop/switch and then eventually back to the beginning of the while(true) loop. You really need to rearrange things here.

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens