Hello, good people. I just started learning C and i can't understand how some things work. I believe i got how printf, scanf and fgets work, but can't figure why when im combining them it fails to work. From what i've read, i was supposed to add \n. And i did and it still doesnt work. The problem is that i cant input anything to be stored in fgets. Why is that and how do i fix it?
Code:
char a[20];
char b[20];
char c[30];
printf("Enter a color \n");
scanf("%s", a);
printf("Enter a plural noun \n");
scanf("%s", b);
printf("Enter your first and last name \n" );
fgets(c, 30, stdin);
printf("You've chosen %s\n", a);
printf("You like %s\n", b);
printf("Was a pleasure meeting you, %s \n", c);