enter name and post of five employees and display using structure in C-Program

//Input name and post of 5 employees and display records using structure.
#include<stdio.h>
#include<conio.h>
main()
{
int i;
struct employee
{
char name[20];
char post[15];

}
e[5];
for(i=0;i<5;i++)
{
printf("Enter Name:\n");
scanf("%s",e[i].name);
printf("\n Enter Post:\n");
scanf("%s",e[i].post);
}
printf("\nName and Post of employee are:");
for(i=0;i<5;i++)
{
printf("\nName=%s\tPost=%s",e[i].name,e[i].post);
}

}

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image