employee database using structure in c

Solutions on MaxInterview for employee database using structure in c by the best coders in the world

showing results for - "employee database using structure in c"
Enya
10 Nov 2016
1#include<stdio.h>
2#include<conio.h>
3struct employee
4{
5 char    name[30];
6 float   salary;
7}
8
9main()
10{
11    int i;
12    struct employee e[5];
13
14for(i=0;i<5;i++)
15{
16printf("\nEnter Name:\t");
17scanf("%s",e[i].name);
18printf("Enter Salary:\t");
19scanf("%f",&e[i].salary);
20}
21printf("\nName and Salary of employees are:");
22
23for(i=0;i<5;i++)
24{
25printf("\nName=%s\tSalary=%f",e[i].name,e[i].salary);
26}
27
28}