The program does not wait for the Enter key to be pressed, but it will wait indefinitely for the character to be entered and the "-" sign will never appear on the screen. How can I make the program wait for input only for a while?
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char c = 'A';
system("stty raw");
c = getchar();
system("stty cooked");
if (c == 'A')
printf("-\n");
else
printf("+\n");
return 0;
}