#include<stdio.h>
main()
{
float basic,da,hra,gross;
printf("\nEnter basic salary=");
scanf("%f",&basic);
if(basic>25000)
{
da=0.6*basic;
hra=0.1*basic;
}
else if(basic<=25000 && basic>15000)
{
da=0.65*basic;
hra=0.15*basic;
}
else
{
da=0.7*basic;
hra=2000;
}
gross=basic+da+hra;
printf("\nDA=%f",da);
printf("\nHouse rent=%f",hra);
printf("\nGross salary=%f",gross);
}
main()
{
float basic,da,hra,gross;
printf("\nEnter basic salary=");
scanf("%f",&basic);
if(basic>25000)
{
da=0.6*basic;
hra=0.1*basic;
}
else if(basic<=25000 && basic>15000)
{
da=0.65*basic;
hra=0.15*basic;
}
else
{
da=0.7*basic;
hra=2000;
}
gross=basic+da+hra;
printf("\nDA=%f",da);
printf("\nHouse rent=%f",hra);
printf("\nGross salary=%f",gross);
}