Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find first non-repeating character 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[] = "swiss";
int freq[256] = {0};
int len = strlen(str);
int i;
printf("String: %s\n", str);
// Count frequency of each character
for(i = 0; i < len; i++) {
freq[(int)str[i]]++;
}
// Find first character with frequency 1
for(i = 0; i < len; i++) {
if(freq[(int)str[i]] == 1) {
printf("First non-repeating character: '%c'\n", str[i]);
return 0;
}
}
printf("No non-repeating character found\n");
return 0;
}