Storing Student Information Using C Structures This article shows how to write a program to store and print the roll number, name, age and marks of a student using structures in C. You’ll learn to define a struct , input student information, and display the details neatly using the keywords program, store and print. Understanding Structures in C What Are Structures? Structures are user - defined data types in C that allow you to group different data types under a single name. They're perfect for organizing related information like student records. Think of a structure as a container that holds multiple pieces of related data together, making your code more organized and easier to manage. Building the Student Structure Let's create a structure to store comprehensive student information including roll number, name, age, and marks. struct Student { int rollNo; char name[50]; int age; float marks;}; 01 Define the Structure Use the struct keyword followed by the structure name 02 Declare Member Variables Add data types for roll number (int), name (char array), age (int), and marks (float) 03 Close with Semicolon Don't forget the semicolon after the closing brace Complete Program Implementation Input and Storage The program prompts users to enter student details and stores them in the structure. Using scanf for numeric data and fgets for the name ensures safe input handling. printf("Enter roll number: ");scanf("%d", &student.rollNo);printf("Enter name: ");fgets(student.name, 50, stdin);printf("Enter age: ");scanf("%d", &student.age);printf("Enter marks: ");scanf("%f", &student.marks); Display Output After storing the data, the program displays all student information in a formatted output using printf statements. printf(" \ nStudent Details: \ n");printf("Roll No: %d \ n", student.rollNo);printf("Name: %s", student.name);printf("Age: %d \ n", student.age);printf("Marks: %.2f \ n", student.marks); 1 Include Headers Add stdio.h for input/output functions 2 Define Structure Create the Student structure template 3 Declare Variable Create a structure variable in main() 4 Get Input Prompt user and store data in structure 5 Display Output Print stored information using printf() Thank You Get in Touch Address: 319 Clematis Street - Suite 900West Palm Beach, FL 33401 Email: support@vultr.com Website: www.vultr.com Learn More Explore comprehensive C programming tutorials and cloud computing solutions at Vultr Practice & Excel Master structures and advance your programming skills with hands - on examples