write a Python program calculate the salary of an employee by using salary equals to basic salary + H R A minus Income Tax assume that employees are categorised into 2 grade 1 and Grade 2 if the employees belong to grade 1 hr calculated 15% basic salary and calculate 30% basic salary if the employee belong to read 2001 calculated 10% basic salary and calculated 25% of basic salary and for both grade employees income tax will be calculated as 5% of basic salary
Answers
Answered by
5
Explanation:
** * C program to calculate gross salary of an employee */ #include <stdio.h> int main() { float basic, gross, da, hra; /* Input basic salary of employee */ printf("Enter basic salary of an employee: "); scanf("%f", &basic); /* Calculate D.A and H.R.A according to specified conditions */ if(basic <= 10000) { da = basic * 0.8; hra = basic * 0.2; } else if(basic <= 20000) { da = basic * 0.9; hra = basic * 0.25; } else { da = basic * 0.95; hra = basic * 0.3; } /* Calculate gross salary */ gross = basic + hra + da; printf("GROSS SALARY OF EMPLOYEE = %.2f", gross); return 0;
Similar questions
English,
6 months ago
English,
6 months ago
Political Science,
1 year ago
Social Sciences,
1 year ago