Pages

Thursday, December 1, 2011

C Programming to calculate Net Salary along with Different Allowances and TAX.


/* To calculate Net Salary */
#include<stdio.h>
#include<stdlib.h>
int main()
{
    float TA,DA,HRA,TAX,BS,NS;
    printf("Input Basic Salary: ");
    scanf("%f",&BS);
    TA=0.05*BS;
    DA=0.03*BS;
    HRA=0.08*BS;
    TAX=0.01*BS;
    NS=BS+TA+DA+HRA-TAX;
    printf("The Net Salary is=%f",NS);
    printf("\nHouse Rent Allowance=%f",HRA);
    printf("\nTravelling Allowance=%f",TA);
    printf("\nDaily Allowance=%f",DA);
    printf("\nTAX=%f",TAX);
    system("pause");
    return 0;
}

No comments:

Post a Comment