编译时操作系统出错。为什么tax_rate 输入前会出现NULL字?
/* Salary accounting.c */
#include <stdio.h>
#include <stdlib.h>
int main()
{
char name[10], period[20];
int id [4];
float salary, tax_rate, tyott_vak, net_salary, net_payment;
printf("Employee Name:");
gets(name);
printf("Payment period:");
gets(period);
printf("Emplyee ID:");
scanf("%d", id);
printf("Monthly Salary is: ", salary);
scanf("%f", &salary);
printf("%s Tax rate is: ", tax_rate);
scanf("%f", &tax_rate);
net_salary = salary - (salary*tax_rate) - (salary*tyott_vak);
printf("Vakuutus is:",tyott_vak);
scanf("%f", &tyott_vak);
puts("\n\n\n\n\n");
puts("
SALARY ACCOUNTING");
printf("%s\n %s\n", name, period);
printf("\t\t\t\t\t %-10s\t %10.2f\n", "Monthly Salary", salary);
printf("\t\t\t\t\t %-10s\t %10.2f\n" "Tax rate", tax_rate);
printf("\t\t\t\t\t %-10s\t %10.2f\n", "Vakuutus rate", tyott_vak);
printf("\t\t\t\t\t %-10s\t %6.2f", net_salary);
system("pause");
return 0;
}