C: Do-While Loop Repeating Too Much!

前端 未结 3 1494
醉梦人生
醉梦人生 2021-01-27 17:05

I have a small program that which is confusing me. I am trying using a loop to take input from user. In case input is wrong, it is repeated again but if it is right, it exits.

3条回答
  •  遇见更好的自我
    2021-01-27 17:54

    First of all, # include and use getc(stdin) to get a character. It'll help you to prevent cursor from moving and putting unnecessary characters to console. Secondly, write the welcome message before the loop.

提交回复
热议问题