Program Console Vignaankosh.com
Execution Panel
Console is empty.
Access array using pointer arithmetic 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.
#include <stdio.h>
int main() {
int arr[] = {10, 20, 30, 40, 50};
int *ptr = arr; // ptr points to arr[0]
printf("Using array indexing:\n");
for(int i = 0; i < 5; i++) {
printf("arr[%d] = %d\n", i, arr[i]);
}
printf("\nUsing pointer arithmetic:\n");
for(int i = 0; i < 5; i++) {
printf("*(ptr + %d) = %d\n", i, *(ptr + i));
}
printf("\nUsing pointer increment:\n");
ptr = arr;
for(int i = 0; i < 5; i++) {
printf("*ptr = %d, ", *ptr);
ptr++;
}
return 0;
}