Calculate The Gross Salary Of An Employee By Giving Basic Salary. DA is 60% of The Basic Salary And HRA Is 15% of The Basic Salary. Gross Salary Is The Sum Of Basic Salary, DA, And HRA.

Calculate The Gross Salary Of An Employee By Giving Basic Salary. DA is 60% of The Basic Salary And HRA Is 15% of The Basic Salary. Gross Salary Is The Sum Of Basic Salary, DA, And HRA.

Code
/*
Calculate the gross salary of an employee by giving basic salary. DA is 60% of basic salary and
HRA is 15% of basic salary. Gross salary is sum of basic salary, DA and HRA.
*/

#include <stdio.h>
int main()
{
    float bas_sal, gross_sal, da, hra;
    printf("Enter Your Basic Salary: ");
    scanf("%f", &bas_sal);
    da = bas_sal * 0.6;
    hra = bas_sal * 0.15;
    printf("Gross Salary: %.2f", bas_sal + da + hra);
    return 0;
}
Output
Enter Your Basic Salary: 12500
Gross Salary: 21875.00

Post a Comment