Program Console Vignaankosh.com
Execution Panel
Console is empty.
Take 3D Array Input from User is an interactive C dry run visualizer from the Multi D 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 layers, rows, cols, i, j, k;
printf("Enter number of layers: ");
scanf("%d", &layers);
printf("Enter number of rows: ");
scanf("%d", &rows);
printf("Enter number of columns: ");
scanf("%d", &cols);
int arr[layers][rows][cols];
printf("\nEnter elements:\n");
for(i = 0; i < layers; i++) {
for(j = 0; j < rows; j++) {
for(k = 0; k < cols; k++) {
printf("arr[%d][%d][%d] = ", i, j, k);
scanf("%d", &arr[i][j][k]);
}
}
}
printf("\nYou entered:\n");
for(i = 0; i < layers; i++) {
printf("Layer %d:\n", i);
for(j = 0; j < rows; j++) {
for(k = 0; k < cols; k++) {
printf("%4d ", arr[i][j][k]);
}
printf("\n");
}
printf("\n");
}
return 0;
}