Basic salary of an employee is input through the keyboard. The DA is 25% of the basic salary while the HRA is 15% of the basic salary. Provident Fund is deducted at the rate of 10% of the gross salary (BS+DA+HRA). Program to calculate the Net Salary.
#include <stdio.h>
int main()
{
float bs, da, hra, pf, gs, ns;
printf("\nEnter basic salary of the employee: ");
scanf("%f", &bs);
da = (bs * 25)/100;
hra = (bs * 15)/100;
gs = bs + da + hra;
pf = (gs * 10)/100;
ns = gs - pf;
printf("\n\nNet Salary: Rs. %.2f", ns);
return 0;
}