I am facing a weird problem in my c program. After getting the float input (salary) from the user, the program ends and skips the lines where it is asking for the integer input (empcode). Can anyone tell me why this is happening and what should I do?
#include <stdio.h>
#include <string.h>
struct employee{
int empcode;
float salary;
char name[30];
};
int main(){
struct employee e1, e2, e3;
printf("\nEnter name for e1: ");
gets(e1.name);
printf("\nEnter salary for e1: ");
scanf("%f", e1.salary);
printf("\nEnter employee code for e1: ");
scanf("%d", e1.empcode);
return 0;
}