I am trying to make a mad libs game but every time I test the first two scanf
functions work, but the fgets
function is not working how it should be.
it keeps printing the same things I want it to but it's showing the mad libs text before the user has a chance to type in the fgets
input
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char color[20];
char COL2[20];
printf("Enter a color: ");
scanf("%s", color);
printf("Enter a another color: ");
scanf("%s", COL2);
printf("Enter a celebrity name: \n");
char celebrity[15];
fgets(celebrity, 15, stdin);
printf("Roses are %s", color);
printf("Violets are %s", COL2);
return 0;
}