#include <stdio.h>
typedef struct employee
{
int time;
int salary;
char name[50];
} emp;
void display(emp *x, int y)
{
for (int i = 0; i < y; i++)
{
printf("\n\n");
printf("name: %s\n", x[i].name);
printf("time: %d\n", x[i].time);
printf("salary: %d\n", x[i].salary);
printf("\n\n");
}
}
void setval(emp *x, int y)
{
for (int i = 0; i < y; i++)
{
printf("enter name\n");
scanf("%s", &x[i].name);
getchar();
printf("enter time\n");
scanf("%d", &x[i].time);
x[i].salary = 2000;
}
for (int i = 0; i < y; i++)
{
if (x[i].time > 8 && x[i].time <= 10)
{
x[i].salary = x[i].salary + 5000;
}
else if (x[i].time > 10 && x[i].time <= 12)
{
x[i].salary = x[i].salary + 10000;
}
else if (x[i].time > 12)
{
x[i].salary = x[i].salary + 15000;
}
}
}
int main()
{
int n;
printf("enter the no. of employee\n");
scanf("%d", &n);
emp s1[n];
setval(s1, n);
display(s1, n);
return 0;
}