You should avoid goto
completely. After 30 years in C, I've never needed one.
Restructure your program to use one of the 3 loop structures.
As for why it executes twice, when you type your answer, how many keys do you actually press? What do you think is now happening?
[edit]
One more thing:
Why use an expensive function like scanf()
to read a single character? getchar()
is specifically designed to read a character without all the overhead.
It won't solve your double-execute problem, though...
[/edit]