Find Gross Salary Example
#include <stdio.h>
int main() {
double basicSalary, allowances, deductions, grossSalary;
// Input the basic salary, allowances, and deductions
printf("Enter the basic salary: ");
scanf("%lf", &basicSalary);
printf("Enter the total allowances: ");
scanf("%lf", &allowances);
printf("Enter the total deductions: ");
scanf("%lf", &deductions);
// Calculate the gross salary
grossSalary = basicSalary + allowances - deductions;
// Display the gross salary
printf("Gross Salary: %.2lf\n", grossSalary);
return 0;
}
Comments
Post a Comment