0
7.2kviews
Create an array of structure to store the details of almost 100 employees. And sort it according to employee ID. Employee details are as follows:(i) Employee Name (ii) Employee (iii) Employee salary
1 Answer
0
168views

Program:

#include<stdio.h>
#include<conio.h>
struct employee {
    char name[20];
    int salary, code;
};
int main() {
    struct employee e[100], temp;
    int i, j;

    for(i=0; i<=99; i++)    {
        printf("Enter the Employee's Name, Code and Salary:");
        scanf("%s %d %d", e[i].name,&e[i].code,&e[i].salary);
    }

    for(i=0; i<=98; i++)    {
        for(j=0; j<=98; j++)    {
            if(e[j].code>e[j+1].code)   {
                temp=e[j];
                e[j]=e[j+1]; …

Create a free account to keep reading this post.

and 4 others joined a min ago.

Please log in to add an answer.