#include <stdio.h> int main() { char ch; int vowelCount = 0; printf("Enter a stream of characters:\n"); while ((ch = getchar()) != '\n') { if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') { vowelCount++; } } printf("Number of vowels: %d\n", vowelCount); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter