In a company an employee is paid as :- if his basic salary is less than Rupees 1500, House rent allowance = 10% of basic salary and daily allowance = 90% of basic salary. If his salary is either equal to or above Rupees 1500 then house rent allowance = rupees 500 and daily allowance = 90% of basic salary. If the employee's salary is input through the keyboard write a program to find his gross salary.

 #include<stdio.h>
void main()
{
//ProgramWithHarsh//
//Calculation of gross salary//
float bs,hra,da,gs;
printf("Enter your basic salary=");
scanf("%f",&bs);


if(bs>=1500)


{

hra=500;            
da=bs*98/100;
}
else


{
hra=bs*10/100;
da=bs*90/100;
}



gs=bs+hra+da;
printf("Gross salary = %f",gs);
}

The output will be

Post a Comment (0)
Previous Post Next Post