Quote Originally Posted by flp1969 View Post
Did you notice the name of the funcion? scanf?!

When you ask to scanf() to get a single char ("%c") from the input stream (stdin) and you type 'y' followed by ENTER ('\r'). BOTH characters are in the stream... If you want ignore "space" chars (' ', '\r', '\n', '\t', '\f' and '\v' - as checked by isspace() macro on ctype.h), add a single space after %c.
The "ENTER" char is '\n', (newline), NOT '\r', (carriage return)!