Tuesday 1 April 2014

7. Lex program to count the number of vowels in a file

The program searches for vowels inside every words and count the number.

for example in the line "A man is Walking" there are 5 vowels namely "a,a,i,a,i"

Here is the code :

%{
int count=0;
%}
%%
[aeiouAEIOU] {printf("%s",yytext);count++;}   
%%
main()
{
    extern FILE *yyin;
    yyin=fopen("new","r");
    yylex();
    printf("\nTotal=%d",count);
}

1 comment:

  1. Wynn casino-resort-hotel-wynn resort, las vegas
    Wynn 삼척 출장마사지 Resort Room. Amenities 정읍 출장안마 Wynn resort 양주 출장안마 rooms include:. 경산 출장마사지 Parent's 통영 출장샵 gaming areas include: Fitness center, golf course, fitness center, salon, hair dryer, room

    ReplyDelete