#include<iostream.h> #include<conio.h> #include<stdio.h> //------------------------------ Student ------------------------------// struct student { char name[25]; char section; int rollno; int semester; int age; }; void read(struct student *); void display(struct student *); main( ) { clrscr(); const int n=2; student genius[n]; student *ptr; for(int i=0;i<n;i++) { ptr=&genius[i]; cout<<\"\\n Enter the Bio-Data of the student no \"<<i+1<<\":\\n\" <<endl; read(ptr); } getch(); clrscr(); for(int j=0;j<n;j++) { ptr=&genius[j]; cout<<\"\\n The Bio-Data of the student no \"<<j+1<<\"is :\\n\"<<endl; display(ptr); } getch(); return 0; } //-------------------------- read(student *) --------------------------// void read(struct student *s) { cout<<\"\\t Enter the Name : \"; gets(s->name); cout<<\"\\t Enter the Roll No : \"; cin>>s->rollno; cout<<\"\\t Enter the Section : \"; cin>>s->section; cout<<\"\\t Enter the Semester : \"; cin>>s->semester; cout<<\"\\t Enter the Age : \"; cin>>s->age; } //------------------------- display(student *) ------------------------// void display(struct student *s) { cout<<\" Name : \"<<s->name<<endl; cout<<\" Roll No : \"<<s->rollno<<endl; cout<<\" Section : \"<<s->section<<endl; cout<<\" Semester : \"<<s->semester<<endl; cout<<\" Age : \"<<s->age<<endl; }