What is structure? Write a C program to input employee id, name, address and post of 20 employees and display them properly.
For information about structure
Write a C program to input employee id, name, address and post of 20 employees and display them properly.
#include<stdio.h>
#include<conio.h>
void main()
{
struct record
{
int id;
char name[30], add[20];
};
struct record a[20];
int i;
printf("\n Enter Employee id, Name and Address of 20 employee");
for(i=0;i<20;i++)
{
scanf("%d%s%s", &a[i].id, a[i].name, a[i].add);
}
for(i=0;i<20;i++)
{
printf("\n Employee id=%d\t Name=%s\t Address=%s", a[i].id, a[i].name, a[i].add);
}
getch();
}
Output


0 Comments
Please do not enter any spam link on comment box