Posts: 5,362
Threads: 2,998
Joined: Feb 2011
Objective
Program in “LEX” to count number of vowels and consonants .
Code:
%{
int count1=0;
int count2=0;
%}
%%
"a"I"e"I"i"I"o"I"u" {printf("%s is vowel",yytext);count1++;}
[a-zA-Z] {printf("%s is constonant",yytext);count2++;}
.I\n {ECHO;}
%%
main()
{
yylex();
printf("%d Vowel =%d constonant=",count1,count2);
}
I wanna calculate total number of vowels and consonants
Posts: 4,577
Threads: 25
Joined: Mar 2013
To get full information or details of Program in “LEX” to count number of vowels and consonants please have a look on the pages
http://studentbank.in/report-program-to-...n-as-input
http://studentbank.in/report-program-in-...e=threaded
if you again feel trouble on Program in “LEX” to count number of vowels and consonants please reply in that page and ask specific fields in Program in “LEX” to count number of vowels and consonants