Program Console Vignaankosh.com
Execution Panel
Console is empty.
Count vowels, digits, spaces in string is an interactive C dry run visualizer from the While 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 <ctype.h>
#include <string.h>
int main() {
char str[100];
int vowels = 0, digits = 0, spaces = 0, i = 0;
printf("Enter a string: ");
fgets(str, sizeof(str), stdin);
str[strcspn(str, "\n")] = '\0';
while(str[i] != '\0') {
char ch = tolower(str[i]);
if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
vowels++;
else if(isdigit(str[i]))
digits++;
else if(isspace(str[i]))
spaces++;
i++;
}
printf("Vowels: %d\n", vowels);
printf("Digits: %d\n", digits);
printf("Spaces: %d\n", spaces);
return 0;
}