You'd have a newline character (\n
) in the input buffer after reading the salary. That is being picked up as the last name in the second iteration. You can ignore that by adding a getchar()
after your last scanf:
while (employee_num <= 10) {
...
printf("Enter salary ");
scanf("%d", &employee[employee_num].salary);
++employee_num;
getchar();
}