Program Console Vignaankosh.com
Execution Panel
Console is empty.
Pass variable by reference using pointer is an interactive C dry run visualizer from the Pointersfunctions 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.
#include <stdio.h>
void changeValue(int *ptr, int newValue) {
*ptr = newValue; // Modify original variable via pointer
}
void increment(int *num) {
(*num)++; // Increment the value at the address
}
int main() {
int x = 10;
int y = 20;
printf("Initial values:\n");
printf("x = %d, y = %d\n", x, y);
// Pass by reference
changeValue(&x, 100);
increment(&y);
printf("\nAfter modifications:\n");
printf("x = %d (changed via pointer)\n", x);
printf("y = %d (incremented via pointer)\n", y);
// Demonstrate that original variable is modified
printf("\nDemonstration: &x = %p, x = %d\n", &x, x);
return 0;
}