0

I'm almost ashamed to ask such a basic question but this makes no sense. Why does the question print twice ? I've tried adding a sleep to make sure it's not the enter key staying pressed too long, but it still did that. Note that it only happens on the second call onwards, which is definitely a clue.

char question() {
    char response = ' ';
    while(response != '+' && response != '-' && response != '=') {
        printf("Respond with + or - or  = : ");
        scanf("%c", &response);
    }
    return response;
}
ice-wind
  • 690
  • 4
  • 20

0 Answers0