Program: 51
Write a program to calculate his gross salary. | Let Us C Solutions
#include int main() { float basic_salary, dallowance, house_rent, gross_salary; printf("Enter Basic Salary: "); scanf("%f",&basic_salary); dallowance = 0.4 * basic_salary; house_rent = 0.2 * basic_salary; gross_salary = basic_salary + dallowance + house_rent; printf("\n Basic Salary: %.2f", basic_salary); printf("\n Dearness Allowance: %.2f", dallowance); printf("\n House Rent: %.2f", house_rent); printf("\n\n Gross Salary: %.2f", gross_salary); getch(); return (0); }
Output:
Enter Basic Salary: 1250.50 Basic Salary: 1250.50 Dearness Allowance: 500.20 House Rent: 250.10 Gross Salary: 2000.80
Leave a Comment