Program Console Vignaankosh.com
Execution Panel
Console is empty.
Insert a substring at a given position is an interactive C dry run visualizer from the String Functions 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>
#include <string.h>
int main() {
char str[100] = "Hello World";
char substr[] = "Beautiful ";
int pos = 6;
printf("Original: %s\n", str);
int len_str = strlen(str);
int len_sub = strlen(substr);
// Shift characters to the right
for(int i = len_str; i >= pos; i--) {
str[i + len_sub] = str[i];
}
// Insert substring
for(int i = 0; i < len_sub; i++) {
str[pos + i] = substr[i];
}
printf("After insertion: %s\n", str);
return 0;
}