Copy one array to another (Element by element) Dry Run in C

Copy one array to another (Element by element) is an interactive C dry run visualizer from the Arrays 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.

Copy one array to another (Element by element) Program Code

#include <stdio.h>
int main() {
    int source[5] = {10, 20, 30, 40, 50}, i;
    int destination[5];
    
    // Copy elements
    for(i = 0; i < 5; i++) {
        destination[i] = source[i];
    }
    
    printf("Source array: ");
    for(i = 0; i < 5; i++)
        printf("%d ", source[i]);
    
    printf("\nDestination array: ");
    for(i = 0; i < 5; i++)
        printf("%d ", destination[i]);
    
    return 0;
}

View the complete Arrays programs page.

Program Console Copy one array to another (Element by element) Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.