GoogelAddUnit1

Thursday, 10 March 2011

C Program to Calculate Employee Gross and Net Salary.

#include<stdio.h>                           
#include<conio.h>
main()
{
int eno,bs;
float hra=0,da=0,gs=0,pf=0,it=0,ns=0;
char name[20];
clrscr();
printf("Enter the eno,name,bs");
scanf("%d%s%d",&eno,name,&bs);

        if(bs<=5000)
        {
        hra=(bs*10)/100;
        da=(bs*15)/100;
        gs=bs+hra+da;
        pf=(gs*3)/100;
        it=(gs*1)/100;
        ns=gs-(pf+it);
        }
        if((bs>5000)&&(bs<=10000))
        {
        hra=(bs*30)/100;
        da=(bs*20)/100;
        gs=bs+hra+da;
        pf=(gs*5)/100;
        it=(gs*2)/100;
        ns=gs-(pf+it);
        }
        printf("\n Name is =%s", name);
        printf("\n Employee No is =%d", eno);
        printf("\n Basic Salary is =%d", bs);
        printf("\n Gross Salary is =%f", gs);
        printf("\n PF is =%f", pf);
        printf("\n IT is =%f", it);
        printf("\n NET Salary is =%f", ns);
        getch();
        }

No comments:

Post a Comment