While-loop ignores scanf the second time

Make sure the scanf discards the newline. Change it to:

scanf(" %c", &loop);
       ^

Leave a Comment