Concatenate Strings (without strcat) Dry Run in C

Concatenate Strings (without strcat) is an interactive C dry run visualizer from the Strings 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.

Concatenate Strings (without strcat) Program Code

#include <stdio.h>
int main() {
    char str1[50] = "Hello ";
    char str2[] = "World!";
    int i = 0, j = 0;
    
    // Find end of first string
    while(str1[i] != '\0') {
        i++;
    }
    
    // Append second string
    while(str2[j] != '\0') {
        str1[i] = str2[j];
        i++;
        j++;
    }
    str1[i] = '\0';
    
    printf("Concatenated: %s\n", str1);
    return 0;
}

View the complete Strings programs page.

Program Console Concatenate Strings (without strcat) Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.