Write a program to enter the salary of an employ and calculate TA
if salary is less than or equalto 50000
TA=5%
if salary is less than or equalto 30000
TA=2%
if salary is less than or equalto 20000
TA=1%
#include<stdio.h>
int main()
{
float a,b,c,d; //The variables are taken in float as the salary can be in decimal
printf("Enter the salary: ");
scanf("%f",&a);//Enter the salary of the employ
b = (5*a)/100;//Finding 5% of the salary
c = (2*a)/100;//Finding 2% of the salary
d = a/100; //Finding 1% of the salary
if (a>=50000)
printf("TA: %f",b); //Print the TA for the salary more then or equal to 50000
else
if(a>=30000)
printf("TA: %f",c); //Print the TA for the salary more than or equal to 30000
else
if(a>=20000)
printf("TA: %f",d); //Print the TA for the salary more than or equal to 20000
else
printf("TA: 0"); //If the salary is 0 then the TA will be 0
}