896+ Capstone Project is Available: Whatsapp: +91-7011258995, Email: sharecodepoint@gmail.com

Program to count the number of vowels and consonants in a given string | Compiler Design | Lex Programs

Compiler Design | Lex Programs to count the number of vowels and consonants in user given the input.


Compiler Design Lap Program:

%{
 #include<s;stdio.h>
 int vowels=0;
 int cons=0;
%}
%%
[aeiouAEIOU] {vowels++;}
[a-zA-Z] {cons++;}
%%
int yywrap()
{
return 1;
}
main()
{
 printf(“Enter the string.. at end press ^d\n”);
 yylex();
 printf(“No of vowels=%d\nNo of consonants=%d\n”,vowels,cons);
} 

Sharecodepoint

Sharecodepoint is the junction where every essential thing is shared for college students in the well-defined packets of codes. We are focused on providing you the best material package like Question papers, MCQ'S, and one NIGHT STUDY MATERIAL. facebook twitter youtube instagram

Post a Comment

Previous Post Next Post

Contact Form