Back To C++ Structures
//program to create a structure student and creating array of structure of 3 variables (example of array of structure variables) #include
#include
struct student { int rollno; char name[20]; int marks; }; void main() { student s[3]; int i; clrscr(); for(i=0;i<3;i++) { cout<<"\nenter rollno of student "<
>s[i].rollno; cout<<"\nenter name of student "<
>s[i].name; cout<<"\nenter marks of student "<
>s[i].marks; } cout<<"\ndisplaying the values \n"; for(i=0;i<3;i++) { cout<<"\nrollno of student "<