%{
#include<stdio.h>
int consonant_count=0;
int voel_count=0;
%}
%%
[aeiouAEIOU] { vowel_count++; }
[a-zA-Z] { consonant_count++; }
.
%%
int yywrap(){
return 1;
}
int main(){
printf("enter the expresion");
yylex();
printf
("
Number of vowels in expression
: %d\n",vowel_count); printf
("
Number of consonants in expression
: %d\n",consonant_count); return 0;
}
JXsKICAjaW5jbHVkZTxzdGRpby5oPgogIGludCBjb25zb25hbnRfY291bnQ9MDsKICBpbnQgdm9lbF9jb3VudD0wOwolfQolJQpbYWVpb3VBRUlPVV0geyB2b3dlbF9jb3VudCsrOyB9ClthLXpBLVpdIHsgY29uc29uYW50X2NvdW50Kys7IH0KLgolJQppbnQgeXl3cmFwKCl7CiAgcmV0dXJuIDE7Cn0KaW50IG1haW4oKXsKICBwcmludGYoImVudGVyIHRoZSBleHByZXNpb24iKTsKICB5eWxleCgpOwogIHByaW50ZigiTnVtYmVyIG9mIHZvd2VscyBpbiBleHByZXNzaW9uOiAlZFxuIix2b3dlbF9jb3VudCk7CiAgcHJpbnRmKCJOdW1iZXIgb2YgY29uc29uYW50cyBpbiBleHByZXNzaW9uOiAlZFxuIixjb25zb25hbnRfY291bnQpOwogIHJldHVybiAwOwp9Cg==