8. Write a program to enter employee's number, name and salary. Calculate the DA, HRA and gross
salary, whereas the DA and HRA are :
Salary
DA
HRA
<=10000
<= 15000
<= 20000
>20000
30%
40%
50%
60%
10%
15%
20%
25%
Gross = salary + DA + HRA.
Answers
Answered by
1
Answer
#include <studio.h>
int main()
{
float salary,gross,da,hra;
printf("enter basic salary for an employee");
scanf("%f",&salary);
if(salary<=10000)
{
da=salary*0.8;
hra=salary*0.2;
}
else if(salary<=15000)
{
da=salary*0.95;
hra=salary*0.3;
}
else if(salary<=20000)
{
da=salary*1.00;
hra=salary*0.35;
}
else if(salary>20000{
da=salary/1.00
hra=salary/0.35}
else{
da=salary/1.00
hra=salary/0.35}
/*calculate gross /*
gross=salary+da+hra;
printf("gross salary of employees=%2f",gross);
return 0;
}
Similar questions