Store details of multiple students Dry Run in C

Store details of multiple students is an interactive C dry run visualizer from the Structures Arrays programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Store details of multiple students Program Code

#include <stdio.h>
#include <string.h>

#define MAX_STUDENTS 100

struct Student {
    int rollNo;
    char name[50];
    float marks;
};

int main() {
    struct Student students[MAX_STUDENTS];
    int n, i;
    
    printf("Enter number of students: ");
    scanf("%d", &n);
    
    // Input details for each student
    for(i = 0; i < n; i++) {
        printf("\n--- Student %d ---\n", i+1);
        printf("Enter Roll No: ");
        scanf("%d", &students[i].rollNo);
        printf("Enter Name: ");
        scanf(" %[^\n]", students[i].name);
        printf("Enter Marks: ");
        scanf("%f", &students[i].marks);
    }
    
    // Display all students
    printf("\n========== STUDENT RECORDS ==========\n");
    printf("%-10s %-30s %-10s\n", "Roll No", "Name", "Marks");
    printf("%-10s %-30s %-10s\n", "-------", "----", "-----");
    
    for(i = 0; i < n; i++) {
        printf("%-10d %-30s %-10.2f\n", 
               students[i].rollNo, students[i].name, students[i].marks);
    }
    
    return 0;
}

View the complete Structures Arrays programs page.

Program Console Store details of multiple students Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.