Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Write a program to read and display the information of
- all the students in the class. */
- #include<stdio.h>
- #include<conio.h>
- typedef struct student
- {
- int roll, fees;
- char name[80], dob[80];
- }stud;
- void main()
- {
- stud info[50];
- int n,i;
- clrscr();
- prinf(" Array Of Strucuture");
- printf("\n Enter Num : ");
- scanf("%d",&n);
- for (i=0; i<n; i++)
- {
- printf("\n Enter Roll : ");
- scanf("%d",&info[i].roll);
- printf(" Enter Name : ");
- fflush(stdin);
- scanf("%s",info[i].name);
- printf(" Enter Fees : ");
- scanf("%d",&info[i].fees);
- printf(" Enter Date Of Birth : ");
- scanf("%s",info[i].dob);
- }
- for (i=0; i<n; i++)
- {
- printf("\n Roll Num : %d",info[i].roll);
- printf("\n Name : %s",info[i].name);
- printf("\n Fees : %d",info[i].fees);
- printf("\n Date Of Birth : %s\n",info[i].dob);
- }
- getch();
- }
Add Comment
Please, Sign In to add comment