#include <stdio.
h>
#include <ctype.h> // For tolower() function
int main() {
char str[100];
int vowels = 0, consonants = 0;
// Input the string
printf("Enter a string: ");
fgets(str, sizeof(str), stdin);
// Loop through each character in the string
for (int i = 0; str[i] != '\0'; i++) {
char ch = tolower(str[i]); // Convert to lowercase for easier comparison
// Check if the character is a vowel
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
vowels++;
}
// Check if the character is a consonant (alphabet but not a vowel)
else if (ch >= 'a' && ch <= 'z') {
consonants++;
}
// Ignore any non-alphabet characters (spaces, punctuation)
}
// Output the results
printf("Vowels: %d\n", vowels);
printf("Consonants: %d\n", consonants);
return 0;
}