I have a program that has a basic menu which uses a switch statement.
Option 1 - Allows the user to print a set of numbers on the screen and then returns to the menu.
Option 2 - Allows the user to print the same set of numbers to an external text file and then returns to the menu.
Option 3 - Allows the user to print the numbers to both the screen and the text file and then returns to the menu.
All options are calling a separate function within the program. Options 1 and 2 are working fine. The problem i have is with option 3. I have got it working by copying and pasting the code from the functions for options 1 and 2 into the function for option 3, but i know this is not the ideal way of doing it.
I have tried having the option 3 selection in the switch statement call the function for option 1 and the function for option 2, but what it does is run the first function and then return to the menu without running the second function.
Can you please offer me some guidance?