This is a simple program or a small project in c for generating salary slip.what is to do simply copy and past in a c language type and run the program.You need to eneter some basic data and salary slip will be generated.
/* PROGRAM FOR PAYSLIP OF AN EMPLOYEE */
void main()
{
int i,a,b;
long int t,t1,t2;
struct date
{
int da_year;
char da_day;
char da_mon;
}d;
struct payslip
{
char name[20],add[5],post[20],mon[10],code[15];
long int pay,da,hra,cca,ma,ot;
int year,loan,adv,oth,fev;
}p;
clrscr();
a=4;b=2; gotoxy(a,b);
printf("%c",201);
a=5;b=2; gotoxy(a,b);
for(i=0;i<=70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=75,b=2; gotoxy(a,b);
printf("%c",187);
a=4;b=3; gotoxy(a,b);
for(i=0;i<=40;i++)
{
printf("%c",186);
b=b+1; gotoxy(a,b);
} /* end of for loop */
b=44; gotoxy(a,b);
printf("%c",200);
a=5; gotoxy(a,b);
for(i=0;i<=70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=75; gotoxy(a,b);
printf("%c",188);
a=75;b=3; gotoxy(a,b);
for(i=0;i<=40;i++)
{
printf("%c",186);
b=b+1; gotoxy(a,b);
} /* end of for loop */
a=5;b=5; gotoxy(a,b);
for(i=0;i<70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=30;b=3; gotoxy(a,b);
printf("TechVas India (P) Ltd.");
b=4;gotoxy(a,b);
printf(" PATNA,(BIHAR) ");
a=5;b=7; gotoxy(a,b);
printf(" NAME: ");
gets(p.name);
b=9; gotoxy(a,b);
printf(" ADDRESS: ");
gets(p.add);
b=11; gotoxy(a,b);
printf(" MONTH: ");
gets(p.mon);
a=45;b=7; gotoxy(a,b);
printf(" POST: ");
gets(p.post);
a=45;b=9; gotoxy(a,b);
printf(" CODE\\DEPARMENT: ");
gets(&p.code);
b=11; gotoxy(a,b);
printf(" YEAR: ");
scanf("%d",&p.year);
a=5;b=13; gotoxy(a,b);
for(i=0;i<70;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=5;b=15; gotoxy(a,b);
printf(" PAYABLE AMOUNTS ");
b=17; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=5;b=19; gotoxy(a,b);
printf(" 1.BASIC SALARY: ");
scanf("%ld",&p.pay);
p.da=(p.pay*4.0)/100;
b=21; gotoxy(a,b);
printf(" 2.DEARNESS ALLOWANCE: %d",p.da);
p.hra=(p.pay*30.0)/100;
b=23; gotoxy(a,b);
printf(" 3.HOUSE RENT ALLOWANCE: %ld",p.hra);
p.cca=(p.pay*7.0)/100;
b=25; gotoxy(a,b);
printf(" 4.TRAVELLING ALLOWANCE: %ld",p.cca);
p.ma=(p.pay*8.0)/100;
b=27; gotoxy(a,b);
printf(" 5.MEDICAL: %ld",p.ma);
p.ot=(p.pay*2.0)/100;
b=29; gotoxy(a,b);
printf(" 6.OTHERS: %ld",p.ot);
b=31; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
t1=p.pay+p.da+p.hra+p.cca+p.ma+p.ot;
a=5;b=33; gotoxy(a,b);
printf(" TOTAL ALLOWANCES: %ld",t1);
a=47;b=15; gotoxy(a,b);
printf(" DEDUCTIONS ");
a=47;b=17; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=47;b=19; gotoxy(a,b);
printf(" 1.LOAN: ");
scanf("%d",&p.loan);
b=21; gotoxy(a,b);
printf(" 2.ADVANCE: ");
scanf("%d",&p.adv);
b=23; gotoxy(a,b);
printf(" 3.PROVIDENT FUND: ");
scanf("%d",&p.fev);
b=25; gotoxy(a,b);
printf(" 4.OTHERS: ");
scanf("%d",&p.oth);
b=27; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
t2=p.loan+p.adv+p.fev+p.oth;
a=47;b=29; gotoxy(a,b);
printf(" TOTAL DEDUCTION: %ld",t2);
a=5;b=35; gotoxy(a,b);
for(i=0;i<70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
t=t1-t2;
a=10;b=37; gotoxy(a,b);
printf("NET SALARY: %ld",t);
b=39; gotoxy(a,b);
{
getdate(&d);
printf("DATE: %d/%d/%d",d.da_day,d.da_mon,d.da_year);
}
a=45;b=37; gotoxy(a,b);
printf(" SIGNATURE ");
b=39; gotoxy(a,b);
printf("HEAD OF DEPARTMENT: ");
b=41; gotoxy(a,b);
printf("CASHIER: ");
b=43; gotoxy(a,b);
printf("DIRECTOR: ");
getch();
} /* end of main function */
/* PROGRAM FOR PAYSLIP OF AN EMPLOYEE */
void main()
{
int i,a,b;
long int t,t1,t2;
struct date
{
int da_year;
char da_day;
char da_mon;
}d;
struct payslip
{
char name[20],add[5],post[20],mon[10],code[15];
long int pay,da,hra,cca,ma,ot;
int year,loan,adv,oth,fev;
}p;
clrscr();
a=4;b=2; gotoxy(a,b);
printf("%c",201);
a=5;b=2; gotoxy(a,b);
for(i=0;i<=70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=75,b=2; gotoxy(a,b);
printf("%c",187);
a=4;b=3; gotoxy(a,b);
for(i=0;i<=40;i++)
{
printf("%c",186);
b=b+1; gotoxy(a,b);
} /* end of for loop */
b=44; gotoxy(a,b);
printf("%c",200);
a=5; gotoxy(a,b);
for(i=0;i<=70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=75; gotoxy(a,b);
printf("%c",188);
a=75;b=3; gotoxy(a,b);
for(i=0;i<=40;i++)
{
printf("%c",186);
b=b+1; gotoxy(a,b);
} /* end of for loop */
a=5;b=5; gotoxy(a,b);
for(i=0;i<70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=30;b=3; gotoxy(a,b);
printf("TechVas India (P) Ltd.");
b=4;gotoxy(a,b);
printf(" PATNA,(BIHAR) ");
a=5;b=7; gotoxy(a,b);
printf(" NAME: ");
gets(p.name);
b=9; gotoxy(a,b);
printf(" ADDRESS: ");
gets(p.add);
b=11; gotoxy(a,b);
printf(" MONTH: ");
gets(p.mon);
a=45;b=7; gotoxy(a,b);
printf(" POST: ");
gets(p.post);
a=45;b=9; gotoxy(a,b);
printf(" CODE\\DEPARMENT: ");
gets(&p.code);
b=11; gotoxy(a,b);
printf(" YEAR: ");
scanf("%d",&p.year);
a=5;b=13; gotoxy(a,b);
for(i=0;i<70;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=5;b=15; gotoxy(a,b);
printf(" PAYABLE AMOUNTS ");
b=17; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=5;b=19; gotoxy(a,b);
printf(" 1.BASIC SALARY: ");
scanf("%ld",&p.pay);
p.da=(p.pay*4.0)/100;
b=21; gotoxy(a,b);
printf(" 2.DEARNESS ALLOWANCE: %d",p.da);
p.hra=(p.pay*30.0)/100;
b=23; gotoxy(a,b);
printf(" 3.HOUSE RENT ALLOWANCE: %ld",p.hra);
p.cca=(p.pay*7.0)/100;
b=25; gotoxy(a,b);
printf(" 4.TRAVELLING ALLOWANCE: %ld",p.cca);
p.ma=(p.pay*8.0)/100;
b=27; gotoxy(a,b);
printf(" 5.MEDICAL: %ld",p.ma);
p.ot=(p.pay*2.0)/100;
b=29; gotoxy(a,b);
printf(" 6.OTHERS: %ld",p.ot);
b=31; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
t1=p.pay+p.da+p.hra+p.cca+p.ma+p.ot;
a=5;b=33; gotoxy(a,b);
printf(" TOTAL ALLOWANCES: %ld",t1);
a=47;b=15; gotoxy(a,b);
printf(" DEDUCTIONS ");
a=47;b=17; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
a=47;b=19; gotoxy(a,b);
printf(" 1.LOAN: ");
scanf("%d",&p.loan);
b=21; gotoxy(a,b);
printf(" 2.ADVANCE: ");
scanf("%d",&p.adv);
b=23; gotoxy(a,b);
printf(" 3.PROVIDENT FUND: ");
scanf("%d",&p.fev);
b=25; gotoxy(a,b);
printf(" 4.OTHERS: ");
scanf("%d",&p.oth);
b=27; gotoxy(a,b);
for(i=0;i<=17;i++)
{
printf("%c",196);
a=a+1; gotoxy(a,b);
} /* end of for loop */
t2=p.loan+p.adv+p.fev+p.oth;
a=47;b=29; gotoxy(a,b);
printf(" TOTAL DEDUCTION: %ld",t2);
a=5;b=35; gotoxy(a,b);
for(i=0;i<70;i++)
{
printf("%c",205);
a=a+1; gotoxy(a,b);
} /* end of for loop */
t=t1-t2;
a=10;b=37; gotoxy(a,b);
printf("NET SALARY: %ld",t);
b=39; gotoxy(a,b);
{
getdate(&d);
printf("DATE: %d/%d/%d",d.da_day,d.da_mon,d.da_year);
}
a=45;b=37; gotoxy(a,b);
printf(" SIGNATURE ");
b=39; gotoxy(a,b);
printf("HEAD OF DEPARTMENT: ");
b=41; gotoxy(a,b);
printf("CASHIER: ");
b=43; gotoxy(a,b);
printf("DIRECTOR: ");
getch();
} /* end of main function */
No comments:
Post a Comment