Write a C program to calculate gross salary from given basic day.

PROGRAM: Write a C program to calculate gross salary from given basic day.

#include<stdio.h>
main()
{
float basicPay,dearnessAllowance,houseRentAllowance,grossSalary,providentFund;
printf("Enter Basic Pay \n");
scanf("%f",&basicPay);
houseRentAllowance=0.2*basicPay;
dearnessAllowance=0.4*basicPay;
providentFund=0.12*basicPay;
grossSalary=basicPay+dearnessAllowance+houseRentAllowance+providentFund;
printf("Basic Pay=%.2f\n",basicPay);
printf("Dearness Allowance=%.2f\n",dearnessAllowance);
printf("House Rent Allowance=%.2f\n",houseRentAllowance);
printf("ProvidentFund=%.2f\n",providentFund);
printf("Gross Salary=%.2f\n",grossSalary);

}

OUTPUT:-

Enter Basic Pay
10000
Basic Pay=10000.00
Dearness Allowance=4000.00
House Rent Allowance=2000.00
ProvidentFund=1200.00
Gross Salary=17200.00

Post a Comment

1 Comments

  1. Wow..... I want to be a wonderful coder I love the programming wow

    ReplyDelete