Write a programe to calculate the gross pay of an employee by inputting basic pay through the key board. His salary break up is as fallows.

 

House rent = 45% of the basic pay.

Medical rent = 15% of the basic pay.

Conveyance allowence = 700(rupees).

 

#include<stdio.h>

#include<conio.h>

int main()

{

float bpay, hr, ma, ca, gpay;

clrscr();

printf(“\n Enter Basic Pay of an emploayee: “);

scanf(“%f”,&bpay);

hr=0.45*bpay;             //45% is equal to 0.45

ma=0.15*bpay;

ca=700;                   //fixed amount

gpay=bpay+hr+ma+ca;

printf(“\n Basic pay of an employee: “);

printf(“\n House rent allowance is = %0.2f”,hr) ;

printf(“\n Medical Allowance is = %f”,ma);

printf(“\n Conveyance allowace is = 700″);

printf(“\n Gros pay os an employee is =%0.2f”,gpay);

getch();

return 0;

}