//Program to calculate payroll analysis of employees
#include<stdio.h>
#include<conio.h>
#include<string.h>
struct employee
{
int id,sal;
char nm[20],dept[20];
};
void main()
{
struct employee e;
float ta,da,hra,pf,net;
clrscr();
printf("\nEnter the details of Employee:");
printf("\nEnter ID: ");
scanf("%d",&e.id);
printf("Enter Name: ");
scanf("%s",e.nm);
printf("Enter Department: ");
scanf("%s",e.dept);
printf("Enter Salary: ");
scanf("%d",&e.sal);
ta=e.sal*1.10;
da=e.sal*0.55;
hra=e.sal*0.25;
pf=e.sal*0.10;
net=e.sal+ta+da+hra-pf;
printf("\n**** Employee Payroll ****\n");
printf("ID\tName\tDept\tSalary\tTA\tDA\tHRA\tPF\tNET");
printf("\n%d\t%s\t%s\t%d\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f",e.id,e.nm,e.dept,e.sal,ta,da,hra,pf,net);
getch();
}
#include<stdio.h>
#include<conio.h>
#include<string.h>
struct employee
{
int id,sal;
char nm[20],dept[20];
};
void main()
{
struct employee e;
float ta,da,hra,pf,net;
clrscr();
printf("\nEnter the details of Employee:");
printf("\nEnter ID: ");
scanf("%d",&e.id);
printf("Enter Name: ");
scanf("%s",e.nm);
printf("Enter Department: ");
scanf("%s",e.dept);
printf("Enter Salary: ");
scanf("%d",&e.sal);
ta=e.sal*1.10;
da=e.sal*0.55;
hra=e.sal*0.25;
pf=e.sal*0.10;
net=e.sal+ta+da+hra-pf;
printf("\n**** Employee Payroll ****\n");
printf("ID\tName\tDept\tSalary\tTA\tDA\tHRA\tPF\tNET");
printf("\n%d\t%s\t%s\t%d\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f",e.id,e.nm,e.dept,e.sal,ta,da,hra,pf,net);
getch();
}
No comments:
Post a Comment
Convey your thoughts to authors.