C Programming Code Examples C > Beginners Lab Assignments Code Examples Store Information(name, roll and marks) of a Student Using Structure Store Information(name, roll and marks) of a Student Using Structure In this program, a structure, student is created. This structure has three members: name (string), roll (integer) and marks (float). Then, a structure variable s is created to store information and display it on the screen. #include <stdio.h> struct student { char name[80]; int roll; float marks; } s; int main() { printf("Enter information:\n"); printf("Enter name: "); scanf("%s", s.name); printf("Enter roll number: "); scanf("%d", &s.roll); printf("Enter marks: "); scanf("%f", &s.marks); printf("Displaying Information:\n"); printf("Name: "); puts(s.name); printf("Roll number: %d\n",s.roll); printf("Marks: %.1f\n", s.marks); return 0; }