Store Student Marks in 3D Array (Students × Subjects × Tests) Dry Run in C

Store Student Marks in 3D Array (Students × Subjects × Tests) is an interactive C dry run visualizer from the Multi D 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 Student Marks in 3D Array (Students × Subjects × Tests) Program Code

#include <stdio.h>
int main() {
    int students = 3, subjects = 4, tests = 2, s, sub, t;
    int marks[3][4][2] = {
        // Student 0
        {{85, 90}, {78, 88}, {92, 95}, {80, 85}},
        // Student 1
        {{75, 80}, {82, 86}, {88, 91}, {70, 78}},
        // Student 2
        {{95, 98}, {88, 92}, {79, 84}, {91, 94}}
    };
    
    printf("Student Marks (students × subjects × tests):\n\n");
    for(s = 0; s < students; s++) {
        printf("Student %d:\n", s+1);
        for(sub = 0; sub < subjects; sub++) {
            printf("  Subject %d: ", sub+1);
            for(t = 0; t < tests; t++) {
                printf("Test%d=%d ", t+1, marks[s][sub][t]);
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}

View the complete Multi D programs page.

Program Console Store Student Marks in 3D Array (Students × Subjects × Tests) Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.