Draw a Flowchart to input the monthly salary of an employee and display the income
Answers
Answered by
0
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
Math,
5 months ago
World Languages,
5 months ago
Physics,
5 months ago
Business Studies,
10 months ago
Math,
1 year ago