[Solved] C-Program – Taking extra entry to end program


Try removing ‘\n’ from the scanf, like this:

scanf ("%i",&x);

Take a look at this discussion for additional info on using ‘\n’ in a scanf:

Using ā€œ\nā€ in scanf() in C

2

solved C-Program – Taking extra entry to end program