I am very new at coding so bare with me. I was using fgets for an assignment which included asking questions to the viewer. Every time I had a line with fgets, it would jump directly to the next question without letting the viewer answer the first question asked. (I'm using Repl.it btw)
Code section that's not working:
printf("What's your eye colour?");
scanf("%s", colour);
printf("What country do you want to visit?");
fgets(country, 20, stdin);
printf("How many pets do you have?");
scanf("%d", &pets);
Result:
What's your eye colour? Blue
What country do you want to visit?How many pets do you have?
I have to use fgets, not scanf because the answer needs to have a blank space. Thank you to anyone that can help out!