C program to Calculate salary of an employee - IProgramX

Q. C Program - The basic salary of an employee is decided at the time of employment, which may be different for different employees. Apart from basic employee gets 10% of basic as house rent, 30 & basic as dearness allowance. A professional tax 5% of basic is deducted from salary. Accept the employee id and basic salary for an employee and output the take home salary of the employee


Program

#include <stdio.h>
#include<math.h>
int main()
{
int id;
float m, bsalary,da, tax,house_rate;
printf("enter emp id :");
scanf("%d",&id);
printf("enter  the basic salary : ");
scanf("%f",&bsalary);
house_rate = (bsalary * 0.1);
da = (bsalary * 0.3);
tax= (bsalary * 0.05);
m=bsalary + ((house_rate+da)-tax);
printf("id : %d salary : %f",id,m);
}


Output:

enter emp id :342
enter  the basic salary : 65342
id : 342 salary : 88211.703125

Post a Comment

0 Comments