#include <stdio.h>
int main() {
int yos;
char gen;
char qual;
printf("Enter your sex (M/F):\n");
scanf("%c", &gen);
printf("Enter your year(s) of service:\n");
scanf("%d", &yos);
printf("Enter your qualification (G/P):\n");
scanf("%c", &qual);
return 0;
}
When I run the above code, I am able to enter values for the first two scanf, but I cannot enter a value for the last scanf. Why is that happening?