/* Arrays Of Structure */
#include<stdio.h>
#include<conio.h>
struct Student
{
int eno;
char name[50];
int age;
};
main()
{
int i=0;
struct Student s1[3];
clrscr();
printf("\n Enter 3 Records\n");
for(i=0;i<3;i++)
{
printf("\n Enter Entrollment No :");
scanf("%d",&s1[i].eno);
printf("\n Enter Your Name :");
scanf("%s",&s1[i].name);
printf("\n Enter Your Age :");
scanf("%d",&s1[i].age);
}
printf("\n Given 3 Records\n");
for(i=0;i<3;i++)
{
printf("\n Entrollment No :%d",s1[i].eno);
printf("\n Your Name :%s",s1[i].name);
printf("\n Your Age :%d",s1[i].age);
}
getch();
}
No comments:
Post a Comment