Tuesday, March 5, 2024

3. Input basic salary. Then find DA=50% of basic salary, HRA=30% of basic salary, PF=20% of basic salary, Medical=5% of basic salary, Gross Salary=Basic salary+DA+HRA-PF-Medical. If gross salary>40000, Bonus=5000, otherwise Bonus=6000.

3. Input basic salary. Then find DA=50% of basic salary, HRA=30% of basic salary, PF=20% of basic salary, Medical=5% of basic salary, Gross Salary=Basic salary+DA+HRA-PF-Medical. If gross salary>40000, Bonus=5000, otherwise Bonus=6000.


#include<stdio.h>

int main()

{

    int bs,da,hra,pf,md,b,gs;

    printf("enter basic salary ");

    scanf("%d",&bs);

    da=bs*50/100;

    hra=bs*30/100;

    pf=bs*20/100;

    md=bs*5/100;

    gs=bs+da+hra-pf-md;

    printf("gross salary=%d\n",gs);

    if(gs>40000)

    {

        gs=gs+5000;

    }

    else

    {

        gs=gs+6000;

    }

    printf("gross salary after bonus=%d",gs);

    return 0;

}


No comments:

Post a Comment