Sunday, 16 June 2019

Write a LEX program to count only those words that start with vowels.


              

               Code :

%{
%}
%%
[aeiouAEIOU][A-Za-z]+              {printf("Word starting with vowel");}
[A-Za-z(^aeiouAEIOU)][A-Za-z]+      {printf("Word not starting with vowel");}
%%
main()
{
     yylex();
}
int yywrap()
{
     return 1;
}

No comments:

Post a Comment

It's time To increase blogging capability. To have a chance to contribute in digital world. Any Interested People who want to make t...