you can end a function at any time with the return statement.
if the function has a value, you must return a value (int foo needs return(number);) while void functions just an empty return works (return;)
You can either loop with a check (if user put in bad stuff, ask for them to enter it again until it is valid, in a loop) or you can exit the function and call the function again in a loop depending on how you want to set that up.