Develop a C program to create a structure emp with the members : name ,age & address .take 10 values through keyboard and detailed information about employees in tabular format . Also display the name of the employees whose age is more than 20.
#include<stdio.h>
#include<conio.h>
struct employee
{
char name[20],address[100];
int age;
};
int main()
{
struct employee emp[10];
int i;
for(i=0;i<10;i++)
{
printf(“ENter the name of the employee: “);
fflush(stdin);
gets(emp[i].name);
printf(“Enter the address: “);
fflush(stdin);
gets(emp[i].address);
printf(“Age: “);
scanf(“%d”,&emp[i].age);
}
for(i=0;i<10;i++)
{
printf(“\n%s\t%s\t%d\n”,emp[i].name,emp[i].address,emp[i].age);
}
for(i=0;i<10;i++)
{
if(emp[i].age>20)
printf(” \n\n\nname of the employees whose age is more than 20 are : “);
printf(“\n%s\t%s\t%d\n”,emp[i].name,emp[i].address,emp[i].age);
}
getch();
}
OUTPUT