Created
March 2, 2017 07:36
-
-
Save VishalVishwakarma/6c7b5ff31a902d9276bca98484221ac1 to your computer and use it in GitHub Desktop.
Simple employee salary payroll program in C using structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
struct emp | |
{ | |
int empno ; | |
char name[10] ; | |
int bpay, allow, ded, npay ; | |
} e[10] ; | |
void main() | |
{ | |
int i, n ; | |
printf("Enter the number of employees : ") ; | |
scanf("%d", &n) ; | |
for(i = 0 ; i < n ; i++) | |
{ | |
printf("\nEnter the employee number : ") ; | |
scanf("%d", &e[i].empno) ; | |
printf("\nEnter the name : ") ; | |
scanf("%s", e[i].name) ; | |
printf("\nEnter the basic pay, allowances & deductions : ") ; | |
scanf("%d %d %d", &e[i].bpay, &e[i].allow, &e[i].ded) ; | |
e[i].npay = e[i].bpay + e[i].allow - e[i].ded ; | |
} | |
printf("\nEmp. No. Name \t Bpay \t Allow \t Ded \t Npay \n\n") ; | |
for(i = 0 ; i < n ; i++) | |
{ | |
printf("%d \t %s \t %d \t %d \t %d \t %d \n", e[i].empno, | |
e[i].name, e[i].bpay, e[i].allow, e[i].ded, e[i].npay) ; | |
} | |
getch() ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sir in line 19 amberson is missed I think sir