// 16. Structure for employee records (name, employee code, salary).
//     Read the records into an array of structures and display the
//     employees whose salary is greater than 10,000.
#include <stdio.h>

struct Employee {
    char name[50];
    int code;
    float salary;
};

int main() {
    struct Employee emp[50];
    int n, found = 0;

    printf("Enter the number of employees: ");
    scanf("%d", &n);

    for (int i = 0; i < n; i++) {
        printf("\nEmployee %d\n", i + 1);
        printf("Name: ");
        scanf("%49s", emp[i].name);
        printf("Employee code: ");
        scanf("%d", &emp[i].code);
        printf("Salary: ");
        scanf("%f", &emp[i].salary);
    }

    printf("\nEmployees with salary greater than 10000:\n");
    printf("%-15s %-10s %s\n", "Name", "Code", "Salary");
    for (int i = 0; i < n; i++) {
        if (emp[i].salary > 10000) {
            printf("%-15s %-10d %.2f\n", emp[i].name, emp[i].code, emp[i].salary);
            found = 1;
        }
    }

    if (!found) {
        printf("No employee has salary greater than 10000\n");
    }

    return 0;
}
