Store Monthly Temperature Data (Year × Month × Day) Dry Run in C

Store Monthly Temperature Data (Year × Month × Day) 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 Monthly Temperature Data (Year × Month × Day) Program Code

#include <stdio.h>
int main() {
    int years = 2, months = 12, days = 31, d;
    float temp[2][12][31];
    
    // Sample data: year 2023, January (month 0), first few days
    temp[0][0][0] = 18.5;  // Jan 1, 2023
    temp[0][0][1] = 19.0;  // Jan 2, 2023
    temp[0][0][2] = 20.5;  // Jan 3, 2023
    temp[0][0][3] = 22.0;  // Jan 4, 2023
    
    printf("Temperature Data (Year × Month × Day):\n\n");
    printf("Year 2023, January:\n");
    for(d = 0; d < 4; d++) {
        printf("  Day %d: %.1f°C\n", d+1, temp[0][0][d]);
    }
    
    printf("\nTotal storage: %d temperature readings\n", years*months*days);
    return 0;
}

View the complete Multi D programs page.

Program Console Store Monthly Temperature Data (Year × Month × Day) Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.