Answer the question
In order to leave comments, you need to log in
Why in C does stdin skip user input?
After running this code, everything goes well - until the moment I enter a double number (the last one) - as soon as I start typing, the program ends immediately (not allowing you to enter a number), the transition to the getch () function;
main(){
int num;
float x;
char ch;
double y;
printf("\n\tEnter int:");
scanf("%d", &num);
printf("\n\tEnter float:");
scanf("%f", &x);
printf("\n\tEnter char:");
scanf("%ñ", &ch);
printf("\n\tEnter double:");
scanf("%lf", &y);
getch();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question