Define a structure and display values Dry Run in C

Define a structure and display values is an interactive C dry run visualizer from the Structures 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.

Define a structure and display values Program Code

#include <stdio.h>

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

int main() {
    struct Student s1;
    
    s1.roll = 101;
    sprintf(s1.name, "Amit Sharma");
    s1.marks = 89.5;
    
    printf("Roll: %d\n", s1.roll);
    printf("Name: %s\n", s1.name);
    printf("Marks: %.2f\n", s1.marks);
    
    return 0;
}

View the complete Structures programs page.

Program Console Define a structure and display values Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.