#include <stdio.h>
#include <conio.h>
const int MAX = 100; // Declares a integer constant MAX.
struct data
{
int day;
int month;
int year;
} ;
struct student
{
char name[30];
long int rollno;
struct data dob;
} ;
struct student bio[MAX];
void main()
{
int i,n;
clrscr ();
printf("How many student' s data required : ");
scanf("%d",&n);
for (i=0; i<=n-1; i++)
{
printf("RECORD NO. %d\n",i+1);
printf("Student name : ");
scanf("%s",&bio[i].name);
printf("Roll no. : ");
scanf("%d",&bio[i].rollno);
printf("'Date of birth : ");
printf("\nDay : ");
scanf("%d",&bio[i].dob.day);
printf("Month : ");
scanf("%d",&bio[i].dob.month);
printf("Year : ");
scanf("%d",&bio[i].dob.year);
}
printf("*****THE ENTERED CONTNENTS ARE : *****\n");
for (i=0; i<=n-1; i++)
{
printf("\nRECORD NO. %d",i+1);
printf("\nStudnent name : %s",bio[i].name);
printf("\nRoll no. : %d",bio[i].rollno);
printf("\nDate of birth : ");
printf("\nDay : %d",bio[i].dob.day);
printf("\nMonth : %d",bio[i].dob.month);
printf("\nYear : %d ",bio[i].dob.year);
}
getch();
}
|