Computer Science, asked by Joyson3554, 1 year ago

write a program in c using structures to calculate the gross income and net income if the attendance,basic pay,grade pay,deductions and allowances are given as input

Answers

Answered by wajahatkincsem
10

/**

 * C program to calculate gross salary of an employee

 */

 

#include <stdio.h>

 

int main()

{

    float basic, gross, da, hra;

 

    /* Input basic salary of employee */

    printf("Enter basic salary of an employee: ");

    scanf("%f", &basic);

 

 

    /* Calculate D.A and H.R.A according to specified conditions */

    if(basic <= 10000)

    {

        da  = basic * 0.8;

        hra = basic * 0.2;

    }

    else if(basic <= 20000)

    {

        da  = basic * 0.9;

        hra = basic * 0.25;

    }

    else

    {

        da  = basic * 0.95;

        hra = basic * 0.3;

    }

 

    /* Calculate gross salary */

    gross = basic + hra + da;

 

    printf("GROSS SALARY OF EMPLOYEE = %.2f", gross);

 

    return 0;

}

Similar questions