I'm currently learning C, and this assignment has come up that has me completely baffled. I know I shouldn't be, as it looks like the simplest thing in the world, but I just can't seem to get this right.
I need an input between 1 and 10. If any other input is received, there is supposed to be an error message before the user is prompted again. After that, I ask for a second input between 1 and 4. Again, if any other input is received, there is supposed to be an error message, followed by a reprompt.
I tried an else-if series, but that didn't function as a loop. Alternatively, my switch statement got stuck in a loop. I've tried every variation of for, while, and do, and none of them seem to be working properly. If someone could give me a hint, or at least tell me which loop type to use and why it should work, I would highly appreciate it.