C Programming Code Examples C > Beginners Lab Assignments Code Examples Program to Store Information of Students Using Structure Program to Store Information of Students Using Structure In this program, a structure, student is created. This structure has three members: name (string), roll (integer) and marks (float). Then, we created a structure array of size 10 to store information of 10 students. Using for loop, the program takes the information of 10 students from the user and displays it on the screen. #include <stdio.h> struct student { char name[50]; int roll; float marks; } s[10]; int main() { int x; printf("Enter information of students:\n"); // storing information for(x=0; x<10; ++x) { s[x].roll = x+1; printf("\nFor roll number%d,\n",s[x].roll); printf("Enter name: "); scanf("%s",s[x].name); printf("Enter marks: "); scanf("%f",&s[x].marks); printf("\n"); } printf("Displaying Information:\n\n"); // displaying information for(x=0; x<10; ++x) { printf("\nRoll number: %d\n",x+1); printf("Name: "); puts(s[x].name); printf("Marks: %.1f",s[x].marks); printf("\n"); } return 0; }