r/C_Homework • • Sep 02 '20

Printf printing previous printf

So I am having issues with my printf statement printing the previous printf statement after the next printf statement. I will provide a link and an image of output to better understand what I mean. My questions are why is it doing this and how do I fix it?

Source: https://pastebin.com/shWqnmKH

Output:

Press r: e

Not valid

Press r: Not valid

Press r: a

Not valid

Press r: Not valid

Press r: r

Valid

2 Upvotes

2 comments sorted by