scanf won’t ask for input the second time [duplicate]

because of newline character already in stdin , this is happening.
use

scanf(" %c", &cont); 

instead of

scanf("%c", &cont);

note one space before %c.

Leave a Comment