Pages

Wednesday, November 30, 2011

C Programming to read basic salary, Travelling Allowance Rate, Daily Allowance Rate, House Rent Allowance Rate and TAX Rate and calculate Net Salary


/* To calculate Net Salary */
#include<stdio.h>
#include<stdlib.h>
int main()
{
    float TA,DA,HRA,TAX,BS,NS,RTA,RDA,RHRA,RTAX;
    printf("Input Basic Salary: ");
    scanf("%f",&BS);
    printf("Enter the rate of Travelling Allowance: ");
    scanf("%f",&RTA);
    printf("Enter the rate of Daily ALlowance: ");
    scanf("%f",&RDA);
    printf("Enter the rate of House Rent Allowance: ");
    scanf("%f",&RHRA);
    printf("Enter the rate of TAX: ");
    scanf("%f",&RTAX);
    TA=RTA/100*BS;
    DA=RDA/100*BS;
    HRA=RHRA/100*BS;
    TAX=RTAX/100*BS;
    NS=BS+TA+DA+HRA-TAX;
    printf("The Net Salary is=%f",NS);
    system("pause");
    return 0;
}

No comments:

Post a Comment