Modify variable using pointer Dry Run in C

Modify variable using pointer is an interactive C dry run visualizer from the Pointersintro 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.

Modify variable using pointer Program Code

#include <stdio.h>
int main() {
    int num = 42;
    int *ptr = &num;
    
    printf("Original value: %d\n", num);
    
    *ptr = 100;  // Modify using pointer
    
    printf("After *ptr = 100: %d\n", num);
    printf("Also via *ptr: %d\n", *ptr);
    
    return 0;
}

View the complete Pointersintro programs page.

Program Console Modify variable using pointer Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.