Use multiple structure variables Dry Run in C

Use multiple structure variables 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.

Use multiple structure variables Program Code

#include <stdio.h>

struct Book {
    char title[100];
    int pages;
    float price;
};

int main() {
    struct Book book1 = {"C Programming", 350, 450.00};
    struct Book book2 = {"Data Structures", 420, 599.50};
    struct Book book3;
    
    // Initialize third book
    sprintf(book3.title, "Algorithms");
    book3.pages = 500;
    book3.price = 799.00;
    
    printf("Book1: %s (%d pages) - Rs.%.2f\n", book1.title, book1.pages, book1.price);
    printf("Book2: %s (%d pages) - Rs.%.2f\n", book2.title, book2.pages, book2.price);
    printf("Book3: %s (%d pages) - Rs.%.2f\n", book3.title, book3.pages, book3.price);
    
    return 0;
}

View the complete Structures programs page.

Program Console Use multiple structure variables Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.