/* C Program => Structure in C
Calibre IT & Management Institute
[ Krishna Suman ]
*/
#include <stdio.h>
#include <conio.h>
int main()
{
struct dob
{
int day;
int month;
int year;
};
struct student
{
struct dob d;
int rollno;
char name[25];
int totalmark;
}stud[25];
int n,i;
clrscr();
printf("Enter total number of students\n\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter details of %d-th student\n\n",i+1);
printf("\nName : ");
scanf("%s",&stud[i].name);
printf("\nRoll number : ");
scanf("%d",&stud[i].rollno );
printf("\nTotal mark : ");
scanf("%d",&stud[i].totalm ark);
printf("\nDate of birth (Format:01 06 2010) : ");
scanf("%d%d%d",&stud[i].d. day,&stud[i].d.month,&stud [i].d.year);
}
clrscr();
printf("\n\n\tSTUDENTS DETAILS:\n");
for(i=0;i<n;i++)
{
printf("\n\nRoll number\t\t:\t%d",stud[i].r ollno);
printf("\nName\t\t\t:\t%s" ,stud[i].name);
printf("\nTotel mark\t\t:\t%d",stud[i].tot almark);
printf("\nDate of birth\t\t:\t%d / %d / %d \n\n",stud[i].d.day,stud[i]. d.month,stud[i].d.year);
}
getch();
return 0;
}
Calibre IT & Management Institute
[ Krishna Suman ]
*/
#include <stdio.h>
#include <conio.h>
int main()
{
struct dob
{
int day;
int month;
int year;
};
struct student
{
struct dob d;
int rollno;
char name[25];
int totalmark;
}stud[25];
int n,i;
clrscr();
printf("Enter total number of students\n\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter details of %d-th student\n\n",i+1);
printf("\nName : ");
scanf("%s",&stud[i].name);
printf("\nRoll number : ");
scanf("%d",&stud[i].rollno
printf("\nTotal mark : ");
scanf("%d",&stud[i].totalm
printf("\nDate of birth (Format:01 06 2010) : ");
scanf("%d%d%d",&stud[i].d.
}
clrscr();
printf("\n\n\tSTUDENTS DETAILS:\n");
for(i=0;i<n;i++)
{
printf("\n\nRoll number\t\t:\t%d",stud[i].r
printf("\nName\t\t\t:\t%s"
printf("\nTotel mark\t\t:\t%d",stud[i].tot
printf("\nDate of birth\t\t:\t%d / %d /
}
getch();
return 0;
}


No comments:
Post a Comment