For all of the programs you are required to create your own functions and a main method to test your functions. It will be up to you on how you structure and named them. Make sure there are no GLOBAL variables. Make sure that you modularized your code as much as possible, so that your main method only calls your functions. 1 .) Create a program that asks user if he/she wants to continue or not. printf("Do you want to proceed (Y/N) ?"); The program must ensure that user types a correct response. Therefore it will keep displaying the question till the user presses Y or N.
Using recursion - void AskToQuit() { printf("Do you want to proceed (Y/N) ?"); char c; scanf(&c); if (c == 'Y') <QUIT> else if (c=='N') <DO NOT QUIT> else AskToQuit(); }
It is a recursion. Am I right?
Yes it is.
thanks
Join our real-time social learning platform and learn together with your friends!