Ensure that input buffer is cleared before scanf()

main
sgoudham 3 years ago
parent 03251e0fc7
commit b23e016509

@ -9,6 +9,7 @@ int main() {
do {
printf("Enter An Operator (+, -, *, /):\nEnter 'e' To Exit:\n");
scanf(" %c", &operator);
while (getchar() != '\n');
if (operator == 'e') {
break;

Loading…
Cancel
Save