Basic Salary | DA(Rs.) | HRA(Rs.) | Conveyance (Rs.) |
---|---|---|---|
>=5000 | 120% basic | 25% Basic | 600 |
bs=>3000 && bs<5000 | 110% basic | 20% basic | 500 |
bs<3000 | 100%basic | 15%basic | 400 |
#include <stdio.h>
int main()
{
float bs,hra,da,cv,gs;
printf("Enter Basic Salary : ");
scanf("%f", &bs);
printf("-------------------------------\n");
if(bs>=5000)
{
da=120*bs/100;
hra=25*bs/100;
cv=600;
}
else
if(bs>=3000 && bs<5000)
{
da= 110*bs/100;
hra=20*bs/100;
cv=500;
}
else
if(bs<3000)
{
da=100*bs/100;
hra=15*bs/100;
cv=400;
}
gs=bs+da+hra+cv;
printf("Basic Salary : %.2f\n",bs);
printf("DA : %.2f\n",da);
printf("HRA : %.2f\n",hra);
printf("Conveyance : %.2f\n",cv);
printf("Gross Salary : %.2f\n",gs);
return 0;
}