Program to do array of structures maintenance.


#include <stdio.h>
#include <conio.h>

struct emp_info
{
int emp_id;
char nm[50];
}emp[2];

void main()
{
int i;
clrscr();
gotoxy(31,1);
printf("Arry of strecture");
gotoxy(26,3);
printf("www.techaravind.blogspot.com");
gotoxy(1,5);
for(i=0;i<2;i++)
{
printf("\n\n\t Enter Employee ID : ");
scanf("%d",&emp[i].emp_id);
printf("\n\n\t Employee Name : ");
scanf("%s",emp[i].nm);
}
for(i=0;i<2;i++)
{
printf("\n\t Employee ID : %d",emp[i].emp_id);
printf("\n\t Employee Name : %s",emp[i].nm);
}
getch();
}

0 comments:

Post a Comment

 
Etutos © 2010-2011